node table: added index on value->'fileUuid' prop#127
Conversation
There was a problem hiding this comment.
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_idxon((value ->> 'fileUuid')::uuid)for thenodetable. - Introduces a dbmigrate migration that runs the new SQL during
up. - Adds a placeholder
downSQL 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.
...on/survey/migrations/sqls/20260319111424-alter-table-node-create-value-file-indexes-down.sql
Outdated
Show resolved
Hide resolved
|
There was a problem hiding this comment.
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
nodefor((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.



No description provided.