Re: Identical Queries - Mailing list pgsql-performance

From Craig A. James
Subject Re: Identical Queries
Date
Msg-id 45E756A3.5020604@modgraph-usa.com
Whole thread Raw
In response to Re: Identical Queries  (Rob Schall <rschall@callone.net>)
List pgsql-performance
Stephan Szabo wrote:
> I tried posting to the bugs, and they said this is a better question for here.
> I have to queries. One runs in about 2 seconds. The other takes upwards
> of 2 minutes. I have a temp table that is created with 2 columns. This
> table is joined with the larger database of call detail records.
> However, these 2 queries are handled very differently.

Even for a temporary table, you should run ANALYZE on it after you fill it but before you query or join to it.  I found
out(the hard way) that a temporary table of just 100 rows will generate dramatically different plans before and after
ANALYZE.

Craig


pgsql-performance by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Identical Queries
Next
From: Tom Lane
Date:
Subject: Re: stats collector process high CPU utilization