Re: Sorting on NUMBER or DATE

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Sat, 12 Jun 2004 09:07:05 -0400
Message-ID: <4fednU9w6LWdnVbdRVn-vw_at_comcast.com>


"Mark D Powell" <Mark.Powell_at_eds.com> wrote in message news:2687bb95.0406081201.6ce82c05_at_posting.google.com...
| "Tomislav Petrovic" <t.petrovic_at_inet.hr> wrote in message
news:<ca3qhr$gp0$1_at_garrison.globalnet.hr>...
| > Which is more expensive (slower), sorting data using NUMBER field or
| > using DATE field....
| > And how much more expensive?
| >
| > Tomy.
|
| Tomy, I believe that in the majority of cases the difference is
| insignificant.
|
| I used dba_ojects to populate a test table with 3 columns: the object
| name for 30 char, the sysdate minus the rownum, and the object_id.
| Then I selected * from my test table to populate the buffer.
|
| Next I "set timing on" in sqlplus and did a select * from my_table
| order by the_date and the_number one after the other. For 39,357 row
| the run time differences were around 5/100 of a second with number
| winning by just a tad.
|
| You should be able to run some more tests, perhaps with a larger
| sample size, and see.
|
| HTH -- Mark D Powell --

Tomy

Good answers, but actually, you should spend your tuning time on things that have a lot more impact -- like making sure indexes are used where appropriate rather than full table scans, and there are no unnecessary PL/SQL loop iterations, your SGA is properly sized, your sorts are tuned, etc. etc.

++ mcs Received on Sat Jun 12 2004 - 15:07:05 CEST

Original text of this message