Re: The Last Optimization

Поиск
Список
Период
Сортировка
От Bill Gribble
Тема Re: The Last Optimization
Дата
Msg-id 1031335607.13961.290.camel@firetrap
обсуждение исходный текст
Ответ на The Last Optimization  ("Areski Belaid" <areski5@hotmail.com>)
Список pgsql-general
On Fri, 2002-09-06 at 12:09, Areski Belaid wrote:
> The "select count" have to check all of them and it's not the case with
> "LIMIT"! Right ?

count() is slow for large tables, period.

If you know that you have some very large tables that need to be counted
frequently, you can make a small table called
"my_counts(tablename TEXT, rows INTEGER)" and update it with INSERT and
DELETE triggers on the tables.  Then, you can define a function which
will read that table rather than executing a query on a large table.

b.g.


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

Предыдущее
От: "Mihai Gheorghiu"
Дата:
Сообщение: Re: Surprise :-(
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Surprise :-(