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

Conversation

nscuro
Copy link
Member

@nscuro nscuro commented Feb 2, 2024

Description

Creates a GIN index on "COMPONENT"."DIRECT_DEPENDENCIES" to support dependency graph traversal.

Traversal is performed using recursive CTEs, with conditions such as:

WHERE "DIRECT_DEPENDENCIES" LIKE ('%' || :componentUuid || '%')

"DIRECT_DEPENDENCIES" is a JSON array containing zero or more JSON objects. Because LIKE is used with wildcards in before and after the UUID, a BTREE index cannot be used.

Addressed Issue

N/A

Additional Details

N/A

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have added corresponding update logic
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

@nscuro nscuro added the enhancement New feature or request label Feb 2, 2024
…pendency graph traversal

Traversal is performed using recursive CTEs, with conditions such as:

```
WHERE "DIRECT_DEPENDENCIES" LIKE ('%' || :componentUuid || '%')
```

`"DIRECT_DEPENDENCIES"` is a JSON array containing zero or more JSON objects. Because `LIKE` is used with wildcards in before and after the UUID, a `BTREE` index cannot be used.

Signed-off-by: nscuro <nscuro@protonmail.com>
@nscuro nscuro force-pushed the component-directdep-gin-index branch from 0918bdb to 1b09dea Compare February 2, 2024 13:56
@nscuro nscuro added this to the 5.3.0 milestone Feb 5, 2024
VithikaS
VithikaS previously approved these changes Feb 7, 2024
nscuro added a commit that referenced this pull request Feb 7, 2024
Signed-off-by: nscuro <nscuro@protonmail.com>
@nscuro nscuro merged commit 032a6eb into main Feb 7, 2024
6 checks passed
@nscuro nscuro deleted the component-directdep-gin-index branch February 7, 2024 14:44
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants