| От | Bruno Wolff III |
|---|---|
| Тема | Re: Strange logic for partial index proving |
| Дата | |
| Msg-id | 20050623155453.GA14442@wolff.to обсуждение исходный текст |
| Ответ на | Re: Strange logic for partial index proving (laser <laser@toping.com.cn>) |
| Список | pgsql-hackers |
On Thu, Jun 23, 2005 at 16:13:24 +0800, laser <laser@toping.com.cn> wrote: > > This thread make me to think about the question: > could this "feature" be used in select count(*) type > query that force it to use index? count(*) can already be helped by indexes, but probably not the way you think. The count isn't saved anywhere, so each row needs to be checked to make sure it is visible to the current transaction and that it satisfies any WHERE conditions. The latter can sometimes be sped up using index scans (typically if the matchin grows are less than 5% of the table or somewhat more if the rows are clustered according to the index). If you are counting all of the visible records in a table a sequential scan is going to be the fastest plan.
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера