Skip to content

node table: added index on value->'fileUuid' prop#127

Merged
SteRiccio merged 2 commits intomasterfrom
fix/node-value-fileuuid-index
Mar 19, 2026
Merged

node table: added index on value->'fileUuid' prop#127
SteRiccio merged 2 commits intomasterfrom
fix/node-value-fileuuid-index

Conversation

@SteRiccio
Copy link
Member

No description provided.

@SteRiccio SteRiccio requested a review from Copilot March 19, 2026 12:44
@SteRiccio SteRiccio self-assigned this Mar 19, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a PostgreSQL expression index on the node.value->>'fileUuid' JSON property to speed up lookups/joins involving file UUIDs stored in node.value.

Changes:

  • Adds node_file_uuid_idx on ((value ->> 'fileUuid')::uuid) for the node table.
  • Introduces a dbmigrate migration that runs the new SQL during up.
  • Adds a placeholder down SQL file (currently not dropping the created index).

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/db/dbMigrator/migration/survey/migrations/sqls/20260319111424-alter-table-node-create-value-file-indexes-up.sql Creates an expression btree index for fileUuid extracted from node.value.
src/db/dbMigrator/migration/survey/migrations/sqls/20260319111424-alter-table-node-create-value-file-indexes-down.sql Down migration SQL is currently a template placeholder.
src/db/dbMigrator/migration/survey/migrations/20260319111424-alter-table-node-create-value-file-indexes.js dbmigrate wrapper that reads/runs the up/down SQL files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SteRiccio SteRiccio requested a review from Copilot March 19, 2026 12:49
@sonarqubecloud
Copy link

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new database migration in the survey dbmigrator to improve query performance on node.value.fileUuid lookups by introducing a dedicated expression index.

Changes:

  • Add an expression index on node for ((value ->> 'fileUuid')::uuid).
  • Add a down migration to drop the new index.
  • Add the dbmigrate JS wrapper to run the up/down SQL files.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
src/db/dbMigrator/migration/survey/migrations/sqls/20260319111424-alter-table-node-create-value-file-indexes-up.sql Creates node_file_uuid_idx on node.value->>'fileUuid' (cast to uuid).
src/db/dbMigrator/migration/survey/migrations/sqls/20260319111424-alter-table-node-create-value-file-indexes-down.sql Drops node_file_uuid_idx on rollback.
src/db/dbMigrator/migration/survey/migrations/20260319111424-alter-table-node-create-value-file-indexes.js Executes the up/down SQL via dbmigrate.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SteRiccio SteRiccio merged commit 8cc4ab8 into master Mar 19, 2026
9 checks passed
@SteRiccio SteRiccio deleted the fix/node-value-fileuuid-index branch March 19, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants