Re: Make COUNT(*) Faster?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Make COUNT(*) Faster?
Дата
Msg-id 23283.1120839143@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Make COUNT(*) Faster?  (Steve Wampler <swampler@noao.edu>)
Список pgsql-sql
Steve Wampler <swampler@noao.edu> writes:
> Tom Lane wrote:
>> If you want something cheap, you could use the same technique the
>> planner uses nowadays: take RelationGetNumberOfBlocks() (which is
>> guaranteed accurate) and multiply by reltuples/relpages.

> Yes - this would be an excellent approximation for my needs!  The
> solution that Dawid Kuroczko suggested (just call "explain select *
> on ..." and parse the result) would be equivalent these days, right?

Close enough (the planner actually does some additional heuristic
stuff to avoid going crazy on corner cases).
        regards, tom lane


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

Предыдущее
От: Ying Lu
Дата:
Сообщение: Index creation question for expression (col1 || '-' || col2)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Index creation question for expression (col1 || '-' || col2)