Skip to content

Extra not required indices? #7

@fanatid

Description

@fanatid

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions