Re: The nested view from hell - Restricting a subquerry - Mailing list pgsql-sql

From Gregory Stark
Subject Re: The nested view from hell - Restricting a subquerry
Date
Msg-id 878x97mip7.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: The nested view from hell - Restricting a subquerry  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-sql
"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



pgsql-sql by date:

Previous
From: Nis Jørgensen
Date:
Subject: Re: The nested view from hell - Restricting a subquerry
Next
From: Andrew Sullivan
Date:
Subject: Re: Database Synchronization