Indices for select count(*)?
От | Alexander Scholz |
---|---|
Тема | Indices for select count(*)? |
Дата | |
Msg-id | dobcn0$24ur$1@news.hub.org обсуждение исходный текст |
Ответ на | Re: Newbie Question: FAQ for database optimization? ("A. Kretschmer" <andreas.kretschmer@schollglas.com>) |
Ответы |
Re: Indices for select count(*)?
Re: Indices for select count(*)? Re: Indices for select count(*)? |
Список | pgsql-general |
Hi, thank you for your answer. Regarding the performance flow when trying to find out how many records are currently being stored in the table, I don't see how an index should help... Nevertheless we've created an unique index on "ID" but SELECT count("ID") from "XYZ" still takes 35 seconds*. (ID is the primary key basing on a sequence, select count(*) isn't faster.) So - what kind of indexing would speed this up then? Thanx in advance! Alexander. *) MSSQL 2005 on the same server takes 4 seconds for this query for the analogue table, and there hasn't any special tuning been applied, too.
В списке pgsql-general по дате отправления: