pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Bruno BAGUETTE <pgsql-ml@baguette.net>
To: pgsql-performance@postgresql.org
Subject: Re: Large querie with several EXISTS which will be often runned
Date: Fri, 27 Jun 2003 08:41:40 -0700
Message-ID: <200306270841.40634.josh@agliodbs.com> (raw)
In-Reply-To: <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAATBuXKOMvlkWzD3KJN6FWLMKAAAAQAAAAkuu6XpjI60+J/K/ijIO7BwEAAAAA@baguette.net>
References: <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAATBuXKOMvlkWzD3KJN6FWLMKAAAAQAAAAkuu6XpjI60+J/K/ijIO7BwEAAAAA@baguette.net>

Bruno,

> I will have to manage more or less 10.000 products with more or less 2-3
> options by products and more or less 40 options-groups.
>
> Do you think that this query will be hard for PostgreSQL (currently
> 7.2.1 but I will migrate to 7.3.2 when going in production environment)
> ?
> How can I improve that query to be faster ?

Collapse the inner EXISTS into a straight join in the outer EXISTS.  Since you 
are merely checking for existence, there is no reason for the subquery 
nesting.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco



view thread (3+ messages)  latest in thread

Message-ID: <200306270841.40634.josh@agliodbs.com>
Permalink:  ../200306270841.40634.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200306270841.40634.josh@agliodbs.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: josh@agliodbs.com, pgsql-ml@baguette.net
  Subject: Re: Large querie with several EXISTS which will be often runned
  In-Reply-To: <200306270841.40634.josh@agliodbs.com>
  References: <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAATBuXKOMvlkWzD3KJN6FWLMKAAAAQAAAAkuu6XpjI60+J/K/ijIO7BwEAAAAA@baguette.net> <200306270841.40634.josh@agliodbs.com>

* 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