Re: Query optimization

From: Siva Kumar <tech(at)leatherlink(dot)net>
To: Richard Huxton <dev(at)archonet(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Query optimization
Date: 2002-10-07 11:28:58
Message-ID: 200210071658.58118.tech@leatherlink.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks to Richard, Neil, Jochem and Antonis.

I went through the documentation on explain/analyse. Finally, decided to split
up the query into two and to reduce the number of tables to get faster query.
In short, I have not solved the problem as presented (too lazy of me :-( ,
but opted to walk an easier path.

Thanks once again.

Best regards,

Siva Kumar

On Friday 04 Oct 2002 6:59 pm, Richard Huxton wrote:
> On Friday 04 Oct 2002 1:26 pm, Siva Kumar wrote:
> > Giving below the output of EXPLAIN ANALYSE. I could not make much sense
> > out of it, please help!
>
> Scary aren't they ;-)
>
> The important thing is you've got plenty of "Index Scan"s rather than Seq
>
> Scans. The other point is the final time:
> > Total runtime: 5.45 msec
>
> Now, since that's not what you're getting, I'd think Neil (see other reply)
> is right and you need to look at issuing "SET geqo = off;" before the
> query.
>
> Postgresql has a genetic algorithm that kicks in on what it thinks is a
> very complex query, this can take a long time to analyse the options
> available but pays dividends on a big query. In your case you're only
> getting a few rows and so it takes longer to analyse than to get the
> results.
>
> The other thing that might work is rewriting the query with explicit JOINs
> - I think that should make it clear to Postgresql what order to do things
> in.
>
> - Richard Huxton

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Larry Rosenman 2002-10-07 11:50:59 Re: [HACKERS] cross-posts (was Re: Large databases,
Previous Message Hans-Jürgen Schönig 2002-10-07 10:01:32 Re: [pgsql-performance] Large databases, performance