Re: count(*) and bad design was: Experiences with extensibility

Поиск
Список
Период
Сортировка
От Ivan Sergio Borgonovo
Тема Re: count(*) and bad design was: Experiences with extensibility
Дата
Msg-id 20080109202741.213ae41a@webthatworks.it
обсуждение исходный текст
Ответ на Re: count(*) and bad design was: Experiences with extensibility  ("Joshua D. Drake" <jd@commandprompt.com>)
Список pgsql-general
On Wed, 9 Jan 2008 10:58:29 -0800
"Joshua D. Drake" <jd@commandprompt.com> wrote:

> > OK... we are getting near to the point. I understand the trade-off
> > problem in storing into indexes id the row is still there.
> > Is there a way to get the count of the rows that *may be* there,

> If you analyze regularly you can use pg_class. It isn't exact but is
> usually close enough (especially if you are just using it for
> something like pagination).

But what if I've a

select count(*) from table where condition;

where condition involves just indexed columns and I want to trust the
indexes and I'm not concerned of the deleted rows?
Just to get an estimate between reindexing cycles, that would be
perfect for paging.

pg_class does look as returning all the rows.

--
Ivan Sergio Borgonovo
http://www.webthatworks.it


В списке pgsql-general по дате отправления:

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: count(*) and bad design was: Experiences with extensibility
Следующее
От: Zoltan Boszormenyi
Дата:
Сообщение: Re: count(*) and bad design was: Experiences with extensibility