From: Christopher Kings-L. <ch...@fa...> - 2004-10-14 02:17:56
|
>>Just to follow up, the PgAdmin folks say that they just live with the >>estimation issue. I do think that we could run analyze after phppgadmin >>table creation without much issue. Does anyone have any feelings about using >>a setting to determine when to switch from count(*) to reltuples? Ie. if >>reltuples comes back at less than say 2000, we will issue a count(*) on the >>table for exact amounts. Granted this would be slower than just reltuples, >>but perhaps not too slow? > > > That sounds like a good idea, just please don't make that number > configurable. It's a bad idea because it's a _mega_ slowdown. With the estimated value, you can get all tables and all their estimated values in one go. With doing counts, you potentially have to query for all tables plus estimates, then do 'n' separate count queries, one for each table. I'm not sure about doing an analyze after table creation - who are we to second guess the years of experience of the postgresql developers? Chris |