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

Fix migrations, Add perf logging, id search limit shortcut #181

Merged
merged 3 commits into from
May 24, 2023
Merged

Conversation

bitner
Copy link
Collaborator

@bitner bitner commented May 24, 2023

[v0.7.7]

Fixed

  • Fix migrations for 0.7.4->0.7.5 and 0.7.5->0.7.6 to use the partition_view rather than the materialized view to avoid issue with refreshing the materialized view when run in the same statement that is accessing the view. Fixes Migration fails from 0.7.4 #180.

Added

  • Add a short cirucit for id searches that sets the limit to be no more than the number of ids in the filter.
  • Add 'timing' configuration variable that adds a "timing" element to the return object with the amount of time that it took to return a search.
  • Reduce locking when updating statistics in the search table. Use skip locked to skip updating last_used and count when there is a lock being held.

@bitner bitner marked this pull request as ready for review May 24, 2023 19:01
@bitner bitner requested a review from mmcfarland May 24, 2023 19:05
RAISE NOTICE 'Items Count: %', items_cnt;
IF items_cnt > 0 THEN
IF items_cnt <= _limit THEN
_limit := items_cnt - 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just following the logic here: the subtraction is so that when the search limit is bumped by 1 to check to see if it needs a "next token", it evens out and still doesn't keep scanning?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep, otherwise it would keep scanning for a next item which we know it wouldn't find

@bitner bitner merged commit 3685609 into main May 24, 2023
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.

Migration fails from 0.7.4
2 participants