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

Extra not required indices? #7

Open
fanatid opened this issue Aug 10, 2022 · 0 comments
Open

Extra not required indices? #7

fanatid opened this issue Aug 10, 2022 · 0 comments

Comments

@fanatid
Copy link

fanatid commented Aug 10, 2022

I was looked on PostgreSQL schema and my eyes catched a few indices.

PRIMARY KEY (pubkey_id, slot, write_version)
);
CREATE INDEX account_write_searchkey on account_write(pubkey_id, slot DESC, write_version DESC);
CREATE INDEX account_write_pubkey_id_idx on account_write(pubkey_id);

It looks like PRIMARY KEY can be replaced by CREATE UNIQUE INDEX account_write_searchkey.
Not sure about index account_write_pubkey_id_idx too, does it make sense to have it while we already have account_write_searchkey? Some queries are more efficient with pubkey index only?

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

No branches or pull requests

1 participant