Question about join

From: Matthew Foster <matthew(dot)foster(at)noaa(dot)gov>
To: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Question about join
Date: 2012-09-14 17:02:54
Message-ID: CAP1ZYZHiD3VSfm-Ov8BgsV_ceXtN2naQkc3FE833=StO3wnH4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I have two tables that represent a one-to-many relationship in our
database. One table is relatively small (~2000 rows) and the other is
relatively large (~65M rows). When I try to join these tables, Postgres
does a sequential scan an the large table. This, combined with the append
and hash join is taking about 3 minutes to complete.

I'm guessing that I am doing something wrong in my query to make it take so
long. Is there a good reference somewhere on how to do joins intelligently?

Matt

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Kevin Grittner 2012-09-14 17:12:42 Re: Question about join
Previous Message Jayadevan M 2012-09-13 05:59:03 Re: Create a new table from records not joined in a left outer join