[EXPLAIN] Nested loops

From: Reg Me Please <regmeplease(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: [EXPLAIN] Nested loops
Date: 2009-01-09 18:06:27
Message-ID: 200901091906.27568.regmeplease@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi.

For an INNER JOINed query, EXPLAIN says that a "nested loop" is responsible
for the big part of the time needed to run.

The 2 tables JOINed are:

T1: multi-million rows
T2: few dozens rows

The join is though a single column in both sides and it's NOT a PK in either
table. But I have indexes in both T1 and T2 for that column.

I've read in the "Explaining EXPLAIN" by Rober Treat
(at http://wiki.postgresql.org/wiki/Image:OSCON2005-ExplainingExplain.sxi)
that this nested loop can be slow because of lacking of indexes.

Is there any hint to try to speed that query up?

As of now, only a REINDEX can help thanks to caching, I presume.
But the EXPLAIN still says there's a slow nested loop.

--
Fahrbahn ist ein graues Band
weisse Streifen, grüner Rand

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Victor Nawothnig 2009-01-09 18:22:28 Re: [EXPLAIN] Nested loops
Previous Message Richard Huxton 2009-01-09 17:59:43 Re: Improving compressibility of WAL files