| От | Clark Evans |
|---|---|
| Тема | Re: [PHP3] [OT]: SELECT COUNT(*) in Postgres |
| Дата | |
| Msg-id | 3702BC1F.C33BB699@manhattanproject.com обсуждение исходный текст |
| Список | pgsql-hackers |
It seems that one topic of discussion regarding the optimizer is that it dosen't know how many rows are in the table untill an analyze is done. Doing SELECT COUNT(*) seems like something often done that also requires the number of rows in the table to be known. Perhaps it would be prudent to keep a running total of the number of active rows for each table cashed? Clark Jordan Krushen wrote: > I know that MySQL doesn't actually hit the tables when doing a SELECT > COUNT(*), and it returns very quickly as a result.. On large Postgres > tables, COUNT(*) is horrendously slow. What I'm wondering is if anybody > here knows a faster way to get the row count, be it an internal Postgres > variable one can access, or if a COUNT(small_primary_key) would be faster. > Any ideas? >
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера