Re: select distinct and index usage
От | Tom Lane |
---|---|
Тема | Re: select distinct and index usage |
Дата | |
Msg-id | 13570.1207620903@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: select distinct and index usage ("David Wilson" <david.t.wilson@gmail.com>) |
Ответы |
Re: select distinct and index usage
|
Список | pgsql-general |
"David Wilson" <david.t.wilson@gmail.com> writes: > It appears to be doing a sequential scan regardless of the set, as if > it doesn't believe it can use the index for some reason More likely, it's getting a cost estimate for the indexscan that's so bad that it even exceeds the 100000000-unit thumb on the scales that's inserted by enable_seqscan=off. You could try setting enable_sort=off also, which'd give you another 100000000 worth of thumb on the scales. And if that doesn't help, reduce random_page_cost to 1 or even less. What I think you'll find, though, is that once you do force an indexscan to be picked it'll be slower. Full-table index scans are typically worse than seqscan+sort, unintuitive though that may sound. regards, tom lane
В списке pgsql-general по дате отправления: