Re: [HACKERS] Tweaking the planner's heuristics for small/empty tables

2011-07-13 Thread Tom Lane
Bruce Momjian writes: > Tom Lane wrote: >> Another reason not to rely completely on the auto-analyze update path is >> that it doesn't work for temp tables, since autovac can't access another >> session's temp tables. It's also worth noting that auto-analyze will >> never kick in at all for table

Re: [HACKERS] Tweaking the planner's heuristics for small/empty tables

2011-07-13 Thread Bruce Momjian
Tom Lane wrote: > Another reason not to rely completely on the auto-analyze update path is > that it doesn't work for temp tables, since autovac can't access another > session's temp tables. It's also worth noting that auto-analyze will > never kick in at all for tables of less than about 60 rows,

Re: [HACKERS] Tweaking the planner's heuristics for small/empty tables

2011-07-13 Thread Tom Lane
"Kevin Grittner" writes: > Tom Lane wrote: >> Another thing that struck me while looking at the code is that the >> curpages clamp is applied to indexes too, which seems like a >> thinko. A table occupying a few pages wouldn't likely have an >> index as big as the table itself is. > But not zer

Re: [HACKERS] Tweaking the planner's heuristics for small/empty tables

2011-07-13 Thread Kevin Grittner
Tom Lane wrote: > Another thing that struck me while looking at the code is that the > curpages clamp is applied to indexes too, which seems like a > thinko. A table occupying a few pages wouldn't likely have an > index as big as the table itself is. But not zero pages, either. > So what I'm

[HACKERS] Tweaking the planner's heuristics for small/empty tables

2011-07-12 Thread Tom Lane
There's a thread over in pgsql-performance http://archives.postgresql.org/pgsql-performance/2011-07/msg00046.php in which the main conclusion was that we need to take a fresh look at the heuristics the planner uses when dealing with small or empty relations. The code in question is in estimate_rel_