Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Does selecting a primary key column in select , from a table do an automatic order by

Re: Does selecting a primary key column in select , from a table do an automatic order by

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 3 Feb 2006 06:11:38 -0800
Message-ID: <1138975898.172511.201240@g14g2000cwa.googlegroups.com>


Ravi, I have two points: First, Jim is right. Normal tables are heap tables and heaps are unordered collections of rows. If you need the result set ordered then specify an "order by" clause. Different plans can result in differently ordered result sets for the same query. With a cost based optimizer the plan can change as the data changes.

Second, where are you doing the summations? Obviously, you are performing them outside the SQL on the result set. Why are you not performing the summations in the query? It would likely be more efficient. From reading your post it seems that you should be using a group by operation.

HTH -- Mark D Powell -- Received on Fri Feb 03 2006 - 08:11:38 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US