"Gregory Stark" <stark(at)enterprisedb(dot)com> writes:
> Nis Jørgensen <nis(at)superlativ(dot)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