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

MODORDSTOR-392 Add index management for custom fields #417

Merged
merged 2 commits into from
Oct 10, 2024

Conversation

alb3rtino
Copy link
Contributor

@alb3rtino alb3rtino commented Jun 14, 2024

Purpose

https://folio-org.atlassian.net/browse/MODORDSTOR-392

This PR introduces dynamic index management for custom fields using database triggers. The dynamic nature of custom fields and the way that SQL queries are constructed prevents defining search indexes for custom fields in advance. This enhancement ensures the presence of search indexes for custom fields and thereby enhances the performance of search and filter operations related to custom fields.

Approach

  • Search indexes are automatically created when new custom fields are added.
  • Search indexes are automatically dropped when custom fields are removed.
  • Targets purchase_order and po_line tables.

Screencast

screencast.webm

The screencast demonstrates the following functionalities for the purchase_order table:

  • Index creation upon adding custom fields.
  • Utilization of indexes during search and filter operations.
  • Index removal upon deletion of custom fields.

Notes

Warnings about missing indexes for custom fields may still appear in the application log. This is because RMB determines the presence of an index based on the schema.json definition, which does not account for dynamically created indexes.

Copy link

sonarcloud bot commented Jun 14, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Aug 15, 2024

@SerhiiNosko
Copy link
Contributor

very smart implementation, thanks, approved

Copy link

sonarcloud bot commented Oct 10, 2024

@alb3rtino alb3rtino merged commit 1677520 into master Oct 10, 2024
8 checks passed
@alb3rtino alb3rtino deleted the MODORDSTOR-392 branch October 10, 2024 09:37
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.

3 participants