VACUUM ANALYZE makes things worse!
VACUUM ANALYZE makes things worse!
От:
"Ian Harding" <ianh@tpchd.org>
Дата:
My troublesome view is called vtb_timecard. This view runs acceptably quickly after re-creating and reloading the database, but is intolerable slow after vacuum analyze. I assume I have inadvertently tricked the optimizer into doing The Wrong Thing somehow, and I hope what it is will be apparent to someone on the list. I have indexes that help out on all the joins in the "s" query, and have tried creating the additional ones such as on timedetail.shiftdiff and timedetail.adjperiod but with no affect. I thought the issue might not only be a missing index on timedetail.adjperiod, but the fact that that field is usually NULL, so I tried populating the nulls with zeroes, creating and index, and analyzing again, still no luck. I have put the schema and explain output on a website where I hope you can find them... http://www.pakrat.com/pgtrouble PS If you are squeamish about an occasional obscenity in remarks, please don't even look, I am sure there are one or two. Ian A. Harding Programmer/Analyst II Tacoma-Pierce County Health Department (253) 798-3549 mailto: iharding@tpchd.org