Partial index is 41x smaller than composite, but speed gain is just noise, tests show
A software developer ran controlled benchmarks on a 10-million-row PostgreSQL queue table to verify common advice about partial versus composite indexes. The partial index proved 41 times smaller (7.6 MB vs 310.4 MB) and stops growing as the table scales, since it only indexes pending rows. However, the expected speed advantage was negligible at 6.9%, effectively statistical noise. A critical finding was that forcing a generic query plan caused the partial index to drop from 11,752 transactions per second to just 7, a 1,673x collapse, while the composite index was unaffected. Additionally, under sustained write churn, the partial index bloated 380 times within 15 minutes without autovacuum intervening, disproving the assumption that a smaller index requires less maintenance.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in