-
Notifications
You must be signed in to change notification settings - Fork 437
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
bug: free page can not use again #15
Comments
Hey @yjhjstz, existing pages with free space are reused (pages aren't deleted) - see |
yes, but if marked insertPage have N pages, How to manage N free pages ? |
|
I see, but to find the free page to insert must seq scan the list , not efficient. /* Metadata of bloom index */
typedef struct BloomMetaPageData
{
uint32 magickNumber;
uint16 nStart;
uint16 nEnd;
BloomOptions opts;
FreeBlockNumberArray notFullPage;
} BloomMetaPageData; is that ok ? |
There are more efficient ways, but I'd like to keep it simple for now. I don't think it'll be an issue for typical usage patterns (in the worst case scenario, it'll end up scanning the list once after a vacuum). Tables and some index types use a free space map, but pgvector needs one for each list (rather than one for the entire index, which isn't supported). Using an array like Bloom indexes would probably work, but it'll add more complexity. |
Hey @yjhjstz, just fyi, found a bug in the vacuum code that caused indexes to not reuse space at all. There's a fix in 0.2.4 (and a test case to prevent regressions - it still uses a single You can shrink existing indexes with: -- Postgres 12+
REINDEX INDEX CONCURRENTLY index_name;
-- Postgres < 12
CREATE INDEX CONCURRENTLY temp_name ON table USING ivfflat (column opclass);
DROP INDEX CONCURRENTLY index_name;
ALTER INDEX temp_name RENAME TO index_name; |
Here only set the first free page, other deleted pages can not be used anymore, this caused index grow larger and larger.
any solution? thanks.
The text was updated successfully, but these errors were encountered: