From: Mark A. Summers <msummers@irtnet.com>
To: pgsql-sql@postgresql.org
Subject: SQL Help
Date: Fri, 26 Jan 2001 14:11:45 -0500
Message-ID: <94si8l$mos$1@news.tht.net> (raw)
I am having trouble with the following query taking forever:
-----
SELECT * FROM ret108108_00, product
WHERE ret108108_00."isbn" = product."Item1"
AND product."SuperCategory" = '1'
AND product."PublisherCode" = 'ZON'
ORDER BY ret108108_00.qty DESC LIMIT 100
----
The problem is the second AND -- if I take this out it runs fine -- is there
any way to optimize it ? I had a similar problem with just Category so I
created a new field in the product file called FullCat which combined
SuperCategory and Category and thus eliminating the 2nd AND clause -- and
that fixed it -- I just didn't want to do the same thing with Publisher.
Before I tried to index Category, SuperCategory ... nothing seemed to help
Any ideas
Thanks in advance
Mark Summers
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: msummers@irtnet.com
Subject: Re: SQL Help
In-Reply-To: <94si8l$mos$1@news.tht.net>
* 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