From: Gregory Stark <stark@enterprisedb.com>
To: Nis Jørgensen <nis@superlativ.dk>
Cc: pgsql-sql@postgresql.org
Subject: Re: The nested view from hell - Restricting a subquerry
Date: Mon, 23 Jul 2007 13:02:28 +0100
Message-ID: <878x97mip7.fsf@oxford.xeocode.com> (raw)
In-Reply-To: <87d4yjmkiw.fsf@oxford.xeocode.com>
References: <46A2CABF.3080108@obviously.com>
<f7v6na$2gc$1@sea.gmane.org>
<2385.1185127507@sss.pgh.pa.us>
<f80r63$8lo$1@sea.gmane.org>
<87y7h74un7.fsf@oxford.xeocode.com>
<f81ep0$emn$1@sea.gmane.org>
<87d4yjmkiw.fsf@oxford.xeocode.com>
"Gregory Stark" <stark@enterprisedb.com> writes:
> Nis Jørgensen <nis@superlativ.dk> writes:
>
>> 1. Look up all order_ids for which (order_id,my_invoice_id) appear in
>> eg_orders
>>
>> 2. Find all rows (in both branches of the UNION) with these id_s
Oh, did you mean look up the order_ids for which there was at least one record
with the invoice_id specified, then look up all records with those order_ids
regardless of invoice_id?
That would work but as you say it would be hard to tell whether it will be any
faster than just processing all the order_ids.
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
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: stark@enterprisedb.com, nis@superlativ.dk
Subject: Re: The nested view from hell - Restricting a subquerry
In-Reply-To: <878x97mip7.fsf@oxford.xeocode.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