Re: A Guide to Constraint Exclusion (Partitioning)
| От | Tom Lane |
|---|---|
| Тема | Re: A Guide to Constraint Exclusion (Partitioning) |
| Дата | |
| Msg-id | 25487.1122139921@sss.pgh.pa.us обсуждение |
| Ответ на | Re: A Guide to Constraint Exclusion (Partitioning) (Greg Stark <gsstark@mit.edu>) |
| Ответы |
Re: A Guide to Constraint Exclusion (Partitioning)
|
| Список | pgsql-hackers |
Greg Stark <gsstark@mit.edu> writes:
> Note also that the index is only useful if the index is *being used*. And
> index scans are much slower than sequential scans.
You miss my point entirely: an indexscan that hasn't got to retrieve any
rows (because it has a constraint that points off the end of the index
range) is extremely fast, and the planner will reliably detect that and
use the index scan over a seqscan (assuming it has statistics showing
the range of indexed values). And this decision is made separately for
each child table, so the fact that a seqscan might be the best bet for
the target partition doesn't stop the planner from using the indexscan
in other partitions.
However, Simon made a fair argument that there are useful cases where
you don't need an index on a partitioning key, so my objection is
answered.
regards, tom lane
В списке pgsql-hackers по дате отправления: