Re: Query Analyzing

Поиск
Список
Период
Сортировка
От Manfred Koizar
Тема Re: Query Analyzing
Дата
Msg-id i8t7iu0t3djti5pnpft8hbfm5v1dkkbtc2@4ax.com
обсуждение исходный текст
Ответ на Query Analyzing  ("Booth, Robert" <Robert_Booth@intuit.com>)
Список pgsql-general
On Wed, 3 Jul 2002 11:02:00 -0700, "Booth, Robert"
<Robert_Booth@intuit.com> wrote:
>In looking at this I see that my index on the grdb table is getting used,
>but all of the other tables are being sequentially scanned.  All of the
>joins are being done on primary key fields but they are all getting
>sequentially scanned, is there something that I'm missing?

Robert,

if you have not yet VACUUM ANALYZEd your db, now's the time to do it.

If you are on v7.2.x, use EXPLAIN ANALYZE;  it gives you not only the
estimated times and row counts, but also the actual numbers.

And finally, a sequential scan is not a bad thing per se.  If a large
fraction of the rows are to be fetched and if these rows are spread
all over the table, a sequential scan is faster than going through an
index and then again ending up reading (almost) all pages.

>  Seq Scan on users lr  (cost=0.00..7.81 rows=281 width=26)

How many rows are in users?  How many of them match your join
criteria?

Servus
 Manfred



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

Предыдущее
От: Manfred Koizar
Дата:
Сообщение: Re: One source of constant annoyance identified
Следующее
От: Curt Sampson
Дата:
Сообщение: Re: recursing down a tree