| От | Merlin Moncure |
|---|---|
| Тема | Re: select count(*) performance |
| Дата | |
| Msg-id | b42b73150708100444x76d8881fkca87772272859d8a@mail.gmail.com обсуждение исходный текст |
| Ответ на | select count(*) performance (runic <runic@gmx.de>) |
| Список | pgsql-performance |
On 8/8/07, runic <runic@gmx.de> wrote: > Hello Group, > > I'm new in PostgreSQL Business, therefore please forgive me a "newbie" > Question. I have a table with ca. 1.250.000 Records. When I execute > a "select count (*) from table" (with pgAdmin III) it takes about 40 > secs. > I think that takes much to long. Can you please give me hints, where > I can search for Improvements? This is a FAQ. This operation is optimized in some other database engines but not in PostgreSQL due to way the locking engine works. There are many workarounds, maybe the easiest is to get an approximate count using select reltuples from pg_class where relname = 'your_table' and relkind = 'r'; merlin
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера