pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Oleg Lebedev <oleg.lebedev@waterford.org>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Slow query
Date: Mon, 24 Mar 2003 17:08:50 -0500
Message-ID: <20749.1048543730@sss.pgh.pa.us> (raw)
In-Reply-To: <993DBE5B4D02194382EC8DF8554A5273113E5F@postoffice.waterford.org>
References: <993DBE5B4D02194382EC8DF8554A5273113E5F@postoffice.waterford.org>

Oleg Lebedev <oleg.lebedev@waterford.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




view thread (112+ messages)  latest in thread

Message-ID: <20749.1048543730@sss.pgh.pa.us>
Permalink:  ../20749.1048543730@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20749.1048543730@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, oleg.lebedev@waterford.org
  Subject: Re: Slow query
  In-Reply-To: <20749.1048543730@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox