Re: getting in a little over my head
From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Fri, 9 Sep 2011 09:17:24 +0100
Message-ID: <840CC2221F934911BC8685C1400C7A7C_at_Primary>
Date: Fri, 9 Sep 2011 09:17:24 +0100
Message-ID: <840CC2221F934911BC8685C1400C7A7C_at_Primary>
Stephane,
It depends on the uniqueness constraints, of course, but I think (based on the
information we have so far)
that the "UNION ALL" should be a "UNION".
FROM (select objectid objid, 'Quote' linktype
FROM quote
WHERE accountid = 128847
union all
select objectid objid, 'Policy' linktype
FROM pol_policy
WHERE accountid = 128847
AND logid = 1) x
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
- Original Message ----- From: "Stephane Faroult" <sfaroult_at_roughsea.com> To: <JSweetser_at_icat.com> Cc: "Oracle L" <oracle-l_at_freelists.org> Sent: Friday, September 09, 2011 8:26 AM Subject: Re: getting in a little over my head
Joe,
I have never been a great fan of execution plans but I have always hated multiple subqueries that kind of "sequentialize" everything. For me, everything depends in your query about the selectivity of accountid in tables quote and pol_policy, and my gut instinct would make me rewrite your query like this:
--
http://www.freelists.org/webpage/oracle-l
Received on Fri Sep 09 2011 - 03:17:24 CDT
