Re: Joining 2 tables with 300 million rows

From: Jeff Trout <threshar(at)torgo(dot)978(dot)org>
To: Amit V Shah <ashah(at)tagaudit(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Joining 2 tables with 300 million rows
Date: 2005-12-09 15:32:12
Message-ID: B2700001-9328-44C3-B90A-BFD49A6FC5F5@torgo.978.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


On Dec 8, 2005, at 5:01 PM, Amit V Shah wrote:

> Hi,
>
> The thing is, although it shows 0.15 seconds, when I run the actual
> query,
> it takes around 40-45 seconds (sorry I forgot to mention that). And
> then
> sometimes it depends on data. Some parameters have very less number of
> records, and others have lot more. I dont know how to read the
> "explan"
> results very well, but looked like there were no sequential scans
> and it
> only used indexes.
>

The planner will look at the data you used and it may decide to
switch the plan if it realizes your're quering a very frequent value.

Another thing that may be a factor is the network - when doing
explain analyze it doesn't have to transfer the dataset to the client.

--
Jeff Trout <jeff(at)jefftrout(dot)com>
http://www.jefftrout.com/
http://www.stuarthamm.net/

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Frank Wiles 2005-12-09 15:47:18 Re: opinion on disk speed
Previous Message Jaime Casanova 2005-12-09 15:06:07 Re: Query not using index