Re: Index Scanning

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Index Scanning
Дата
Msg-id 459B9FCB.1010405@archonet.com
обсуждение исходный текст
Ответ на Index Scanning  (Enrico <scotty@linuxtime.it>)
Ответы Re: Index Scanning  (Enrico <scotty@linuxtime.it>)
Список pgsql-general
Don't forget to cc the list

Enrico wrote:
> On Wed, 03 Jan 2007 10:55:03 +0000
> Richard Huxton <dev@archonet.com> wrote:
>
>> You're fetching all the rows from both tables - what would an index scan
>> gain you
>
> there is a join

Yes, there is a join. Between all the rows in tmp_righe_bolle_carico
(tr) and all the matches in bolle_carico_testata (tb). It looks like
there is one row in (tb) that matches each in (tr).

What do you expect two index scans over both tables would gain you?
You seem to be saying that you think:
   fetching 22420 index entries on tr + fetching 22420 rows in tr
+ fetching 22420 index entries on tb + fetching 22420 rows in tb
+ merge-join
would be faster than the hash-join you've got. I think it's unlikely
that's the case.

If you issue "set enable_seqscan = off" before the query that should
force it to use the indexes first. What does that plan show you?

--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: Ron Johnson
Дата:
Сообщение: Re: queueing via database table?
Следующее
От: "hubert depesz lubaczewski"
Дата:
Сообщение: "no unpinned buffers available" ? why? (hstore and plperl involved)