Skip site navigation (1) Skip section navigation (2)

query optimization

From: Richard Kojedzinszky <krichy(at)tvnetwork(dot)hu>
To: pgsql-performance(at)postgresql(dot)org
Subject: query optimization
Date: 2012-04-24 08:11:43
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
Dear list,

We have a database schema, which looks the same as the attached script.

When filling the tables with data, and skipping analyze on the table (so 
pg_stats contains no records for table 'a'), the first select in the 
script runs fast, but after an analyze the planner decides to sequence 
scan tables b and c, thus making the query much slower. Can somebody help 
me solving this issue, or tuning our installation to not to use sequence 
scans in this case?

Thanks in advance,

Kojedzinszky Richard
Euronet Magyarorszag Informatikai Zrt.

Attachment: test.sql
Description: application/x-sql (834 bytes)


pgsql-performance by date

Next:From: Shaun ThomasDate: 2012-04-24 19:32:49
Subject: Re: Configuration Recommendations
Previous:From: Robert KlemmeDate: 2012-04-24 05:53:30
Subject: Re: Configuration Recommendations

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group