Re: Joining 2 tables with 300 million rows - Mailing list pgsql-performance

From Jeff Trout
Subject Re: Joining 2 tables with 300 million rows
Date
Msg-id B2700001-9328-44C3-B90A-BFD49A6FC5F5@torgo.978.org
Whole thread Raw
In response to Re: Joining 2 tables with 300 million rows  (Amit V Shah <ashah@tagaudit.com>)
List 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@jefftrout.com>
http://www.jefftrout.com/
http://www.stuarthamm.net/



pgsql-performance by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: Query not using index
Next
From: Frank Wiles
Date:
Subject: Re: opinion on disk speed