Re: improving my query plan

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Kevin Kempter" <kevink(at)consistentstate(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: improving my query plan
Date: 2009-08-24 14:45:42
Message-ID: 4A9261460200002500029FE2@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Kevin Kempter <kevink(at)consistentstate(dot)com> wrote:

> I have a simple query against two very large tables ( > 800million
> rows in theurl_hits_category_jt table and 9.2 million in the
> url_hits_klk1 table )

> I get a very high overall query cost:

> Hash Join (cost=296959.90..126526916.55 rows=441764338 width=8)

Well, the cost is an abstraction which, if you haven't configured it
otherwise, equals the estimated time to return a tuple in a sequential
scan. This plan is taking advantage of memory to join these two large
tables and return 441 million result rows in the time it would take to
read 126 million rows. That doesn't sound like an unreasonable
estimate to me.

Did you think there should be a faster plan for this query, or is the
large number for the estimated cost worrying you?

-Kevin

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Gavin Love 2009-08-24 16:27:49 Indexing on a circle datatype
Previous Message Tom Lane 2009-08-24 14:37:04 Re: postgresql uses Hash-join, i need Nested-loop