2 ms·
They were showing a pathological case where there are a very large number of columns and table scanning is the only option the optimiser has, so in most cases i
by dspillett 4y ago
They were showing a pathological case where there are a very large number of columns and table scanning is the only option the optimiser has, so in most cases it won't matter significantly (removing the need to scan at all will fix that, by adding indexes or altering the query to make filtering and joining clauses sargable).
This is more an interesting experiment than something you generally need to worry about, and if you do need to worry about it there are other things you may need to fix first (do you really need 1,500 columns on that table, is there not a design that is orders of magnitude more efficient generally thus making this issue measurable but insignificant?).
PG could be refactored to make these cases much more efficient, but the developer (and QA) time required would be much better spent elsewhere and the changes needed may impact the performance of other operations that occur far more regularly in both good and bad designs.