Re: Query Tuning

From: Pallav Kalva <pkalva(at)deg(dot)cc>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query Tuning
Date: 2004-10-08 17:29:22
Message-ID: 4166CE72.2050900@deg.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Tom Lane wrote:

>Pallav Kalva <pkalva(at)deg(dot)cc> writes:
>
>
>> I have a problem with the below query, when i do explain on the
>>below query on my live database it doesnt use any index specified on the
>>tables and does seq scan on the table which is 400k records. But if i
>>copy the same table onto a different database on a different machine it
>>uses all the indexes specified and query runs much quicker.
>>
>>
>
>It looks to me like you've never vacuumed/analyzed the copy, and so you
>get a different plan there. The fact that that plan is better than the
>one made with statistics is unhappy making :-( ... but when you only
>show us EXPLAIN output rather than EXPLAIN ANALYZE, it's impossible to
>speculate about why. Also, what PG version is this?
>
> regards, tom lane
>
>
>
Thanks! for the quick reply. I cant run the EXPLAIN ANALYZE on the live
database because, it takes lot of time and hols up lot of other queries
on the table. The postgres version I am using is 7.4 . when you say " i
never vacuum/analyxed the copy" you mean the Live database ? or the copy
of the live database ? . I run vacuum database daily on my live database
as a part of daily maintanence.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Gary Doades 2004-10-08 19:32:22 Odd planner choice?
Previous Message Tom Lane 2004-10-08 16:42:56 Re: Query Tuning