Re: Potential autovacuum optimization: new tables - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: Potential autovacuum optimization: new tables
Date
Msg-id 5078C0EE.2030107@agliodbs.com
Whole thread Raw
In response to Potential autovacuum optimization: new tables  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Potential autovacuum optimization: new tables  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
All,

> 1. User creates new table
> 2. User inserts 45 records into new table.
> 3. Time passes.
> 4. User creates a query which joins against new table.
> 5. Planner uses estimate of 1000 rows for the new table.
> 6. User gets very bad query plan.

Because Snowman asked me for an example:

Before ANALYZE on the new table:

http://explain.depesz.com/s/36D

After ANALYZE on the new table:

http://explain.depesz.com/s/851t

That's a 25X difference in execution time.  This is not the first time
I've seen this issue.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



pgsql-hackers by date:

Previous
From: John R Pierce
Date:
Subject: Re: Successor of MD5 authentication, let's use SCRAM
Next
From: Tom Lane
Date:
Subject: Re: Potential autovacuum optimization: new tables