-- But when searching the general ledger for transactions belonging to the progeny 
-- of project 5, the optimizer produces the union first.  It then has to process 
-- 300,000 records to find the few it needs (even though the desired fields are 
-- indexed in the underlying tables).

--explain analyze
select lg.*
    from 	gen_ledg	lg
    join	proj_rel	pr	on pr.prog_id = lg.proj
    where	pr.anst_id = 5;