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

Re: Slow query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Oleg Lebedev <oleg(dot)lebedev(at)waterford(dot)org>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Slow query
Date: 2003-03-24 22:08:50
Message-ID: 20749.1048543730@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Oleg Lebedev <oleg(dot)lebedev(at)waterford(dot)org> writes:
> I just ran the query you sent me and attached the output of EXPLAIN
> ANALYZE as TOMs_plan.txt
> It did not speed up the query significantly.

Nope.  I was hoping to see a faster-start plan, but given the number of
rows involved I guess it won't change its mind.  You're going to have to
think about a more intelligent approach, rather than minor tweaks.

One question: since objectid is evidently a primary key, why are you
doing a subselect for the first part?  Wouldn't it give the same result
just to say "m.activity = '347667'" in the top-level WHERE?

As for the second part, I think you'll have to try to rewrite it as a
join with the media table.

			regards, tom lane


In response to

pgsql-performance by date

Next:From: Oleg LebedevDate: 2003-03-24 22:37:10
Subject: Re: Slow query
Previous:From: Oleg LebedevDate: 2003-03-24 21:46:09
Subject: Re: Slow query

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