Re: query speed depends on lifetime of frozen db?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Andriy Tkachuk <ant(at)imt(dot)com(dot)ua>
Cc: pgsql-general(at)postgresql(dot)org, uzel(at)imt(dot)com(dot)ua
Subject: Re: query speed depends on lifetime of frozen db?
Date: 2002-09-28 02:05:58
Message-ID: 20020928020558.GA28628@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Fri, Sep 27, 2002 at 05:58:05PM +0300, Andriy Tkachuk wrote:
> On Fri, 27 Sep 2002, Martijn van Oosterhout wrote:
>
> > On Fri, Sep 27, 2002 at 01:28:13PM +0300, Andriy Tkachuk wrote:
> > > On Fri, 27 Sep 2002, Martijn van Oosterhout wrote:
> > > > What is the output of EXPLAIN ANALYSE <query>;
> > >
> > > There is EXPLAIN ANALYSE when query is heavy:
> >
> > Oookaaay. Your query is *evil*. 14 subqueries executed for *each* row of
> > output!?! I reackon you could improve your query just by rewriting it into a
> > better form. How can you have 10 subqueries to the same table?
>
> YES! You right!
> Just after restirong db i made vacuumdb -z -f
> and query become heavy!
>
> Does one have any ideas how to ovecome this!?

Firstly, how is calc_account() defined? Is it doing subqueries? If it is
then the planner won't be seeing them. Is it optimised?

calc_account (u.uid, 1030827600) as start_account,
calc_account (u.uid, 1032178388) as end_account,

--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Matt Wagner 2002-09-28 03:28:57 Quick Pg/PLSQL question
Previous Message Mark Kirkwood 2002-09-28 01:38:52 Re: Performance while loading data and indexing

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthew T. O'Connor 2002-09-28 03:03:25 Re: Reconstructing FKs in pg_dump
Previous Message Mark Kirkwood 2002-09-28 01:38:52 Re: Performance while loading data and indexing