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

Re: query speed depends on lifetime of frozen db?

From: Andriy Tkachuk <ant(at)imt(dot)com(dot)ua>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
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-27 14:58:05
Message-ID: 20020927175503.B28121-100000@pool.imt.com.ua (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
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?
>
> Anyway, the only thing that seems to change is the statistics, which leads
> me to beleive that all that is happening is that the planner is reordering some
> of your clauses causing it to execute expensive ones it may otherwise be
> able to avoid. In your case the default statistics do better than the real
> ones.

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!?

Thanks a lot Martijn,
  Andriy.


In response to

Responses

pgsql-hackers by date

Next:From: scott.marloweDate: 2002-09-27 15:16:03
Subject: Re: Performance while loading data and indexing
Previous:From: Masaru SugawaraDate: 2002-09-27 14:53:04
Subject: Re: About connectby() again

pgsql-general by date

Next:From: Magnus Naeslund(f)Date: 2002-09-27 15:13:23
Subject: How do i make use of listen/notify properly
Previous:From: Karel ZakDate: 2002-09-27 14:16:51
Subject: Re: Formatting numbers in psql?

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