ckamm/solana-accountsdb-connector

Extra not required indices?

Opened this issue · 0 comments

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?