Re: Tweaking the planner's heuristics for small/empty tables
| От | Tom Lane |
|---|---|
| Тема | Re: Tweaking the planner's heuristics for small/empty tables |
| Дата | |
| Msg-id | 4388.1310569176@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Tweaking the planner's heuristics for small/empty tables ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>) |
| Список | pgsql-hackers |
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> Tom Lane <tgl@sss.pgh.pa.us> 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.
Huh? I think you misread the test. Keep in mind that the starting
value of curpages is the actual current size of the relation (as
reported by lseek(SEEK_END)). The clamp action is triggering if
pg_class.relpages is zero, indicating (approximately) that we've never
yet run vacuum on the relation.
BTW, in some quick testing it seems like a newly-created index will
start out with relpages nonzero anyway, making the point moot; so adding
a relkind test here is really more documentation than anything else.
regards, tom lane
В списке pgsql-hackers по дате отправления: