Re:dbdev - The Database Package Manager for PostgreSQL Trust...
by claytongulick on Friday April 14, 2023 @12:59PM
(#35571798)
Cool idea for an extension!
I had a whole set of comments about concerns about doing this to a large table in prod, and statistics and such - then I read about hypopg.
What a neat package, learned something new today.
It uses the hypopg package to very quickly generate an index for each column referenced in the query and then re-run's an explain plan to measure the estimated "total cost".
If the expected "total_cost" reduces, we add the indexes to the list of recommendations and continue testing the remaining columns.
Its currently limited to single column indexes only but in a later update we'll enhance that to do more comprehensive searches with multiple columns in a single index