| От | Bruno Wolff III |
|---|---|
| Тема | Re: slow count() |
| Дата | |
| Msg-id | 20050128053834.GA11394@wolff.to обсуждение исходный текст |
| Ответ на | slow count() (Zavier Sheran <zsheran@yahoo.com>) |
| Список | pgsql-performance |
On Thu, Jan 27, 2005 at 21:17:56 -0800, Zavier Sheran <zsheran@yahoo.com> wrote: > quote from manual: > -- > Unfortunately, there is no similarly trivial query > that can be used to improve the performance of count() > when applied to the entire table > -- > > does count(1) also cause a sequential scan of the > entire table? It should be able to just use the > primary keys. No it can't just use the index file, so that an index scan will be slower than the sequential scan unless there is a where clause restricting the number of rows to a small fraction (about 5%) of the table. Search the archives for if you want to read more about this.
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера