Re: Query Optimization

Поиск
Список
Период
Сортировка
От Zach Calvert
Тема Re: Query Optimization
Дата
Msg-id 89af81ab0905271349x845c6cai88ec0f62336b8a18@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Query Optimization  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
Ah, I thought it was the other way.  I thought a significant count of
rows WOULD switch to an index scan.  Yes, this query can easily obtain
around 30-50% of the rows in the table.  My apologies.



Zach Calvert

On Wed, May 27, 2009 at 2:53 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Zach Calvert <zachcalvert@hemerasoftware.com> writes:
>> I've added the leaderboardid, score index and it still does the
>> sequential scan.  I'm going to try inserting a few hundred thousand
>> rows and seeing if it switches to index scan.
>
> You didn't answer the critical question, which is what fraction of the
> table rows this query selects.  If it's a large fraction then the
> planner never will switch to indexscan, no matter what the table size
> --- and it'll be doing the right thing.  Indexscans aren't magic.
>
>                        regards, tom lane
>

В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Query Optimization
Следующее
От: Jasen Betts
Дата:
Сообщение: Re: PG commands not working?