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

RE : Large querie with several EXISTS which will be often runned

From: "Bruno BAGUETTE" <pgsql-ml(at)baguette(dot)net>
To: "'Josh Berkus'" <josh(at)agliodbs(dot)com>,"'Bruno BAGUETTE'" <pgsql-ml(at)baguette(dot)net>,<pgsql-performance(at)postgresql(dot)org>
Subject: RE : Large querie with several EXISTS which will be often runned
Date: 2003-06-28 09:17:42
Message-ID: !~! (view raw or whole thread)
Lists: pgsql-performance
Hello Josh,

> > 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.

Do you mean this query ?

FROM products_options_groups
	FROM products_options_classification
	INNER JOIN products_options ON products_options.pk_prdopt_id =
	WHERE products_options_classification =
	AND products_options.fk_prd_id = [A PRODUCT ID WRITTEN HERE BY
ORDER BY products_options_groups.prdoptgrp_name;

An other question, do you think that my tables are OK or is there some
things I could change in order to have as much performance as possible
(without de-normalize it because I want to avoid redundancy in my

Thanks very much for your tips ! :-)

Bruno BAGUETTE - pgsql-ml(at)baguette(dot)net 

In response to


pgsql-performance by date

Next:From: Shridhar DaithankarDate: 2003-06-28 09:35:00
Subject: Re: Large querie with several EXISTS which will be often runned
Previous:From: Arjen van der MeijdenDate: 2003-06-27 20:55:40
Subject: Re: Memory question

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