Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create GIN index on "COMPONENT"."DIRECT_DEPENDENCIES" to support dependency graph traversal #551

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/main/resources/migration/changelog-v5.3.0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2444,4 +2444,30 @@
<changeSet id="v5.3.0-12" author="sahibamittal">
<dropTable tableName="CPE"/>
</changeSet>

<changeSet id="v5.3.0-13" author="nscuro@protonmail.com">
<!--
CREATE EXTENSION requires SUPERUSER (Postgres < 13) or CREATE privileges (Postgres >= 13).
Either configure a migration user with sufficient privileges via database.migration.username
and database.migration.password, or create the extension manually. The below statement will
not fail if the extension already exists, even though the user might now have sufficient
privileges to create it.
-->
<sql>
CREATE EXTENSION IF NOT EXISTS PG_TRGM;
nscuro marked this conversation as resolved.
Show resolved Hide resolved
</sql>
</changeSet>

<changeSet id="v5.3.0-14" author="nscuro@protonmail.com" runInTransaction="false">
<!--
Create a GIN index to support LIKE '%foo%' queries for dependency graph traversal.
Creating this index on an existing database might take a while, so do it concurrently
to not block writes on the "COMPONENT" table. Index creation cannot run in a transaction
when using CONCURRENTLY.
-->
<sql>
CREATE INDEX CONCURRENTLY IF NOT EXISTS "COMPONENT_DIRECT_DEPENDENCIES_GIN_IDX"
ON "COMPONENT" USING GIN ("DIRECT_DEPENDENCIES" GIN_TRGM_OPS);
</sql>
</changeSet>
</databaseChangeLog>
Loading