Subject: 10g/9i: ORDER BY in view vs. ORDER BY in SELECT 2007-08-30 - By Martin Klier
Back Hi DBA's,
is there any difference in query plans if I do "order by" within a view or alternatively order my data in the select _on_ the view?
My tests with 10gR2 did not show any difference in query plans with order by in view vs. order by in the select on the view.
Theoretically it's possible that using the "order by" in the select statement is more efficient, since it will order only the limited results, not the whole view result. But since the optimizer often does sophisticated things, I wondered if it will optimize the contrary case? I have not been able to find Oracle documentation on that special case. And if yes, how can I control/proof that behaviour in 10g and/or 9i?
Thanks a lot and best regards, -- Freundliche Gr??e
i.A. Martin Klier Systemadministration/Datenbanken -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- A.T.U Auto-Teile-Unger Handels GmbH & Co. KG Dr.-Kilian-Str. 4 92637 Weiden i.d. OPf.
Tel.: +49 961 306-5663 Fax : +49 961 306-5982
martin.klier@(protected) www.atu.eu
Sitz: Weiden i. d. Opf., Amtsgericht Weiden i. d. OPf., HRA 2012 UST-ID Nr. DE814195392, WEEE-Nr. DE53789710 Pers?nlich haftende Gesellschafterin: AFM Autofahrerfachmarkt Gesch?ftsf?hrungs GmbH Sitz: Weiden i. d. OPf., Amtsgericht Weiden i. d. OPf., HRB 2842 Gesch?ftsf?hrer: Karsten Engel, Dirk M?ller, Manfred Ries -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---
|
|