Re: Sorting on NUMBER or DATE
Date: 8 Jun 2004 13:01:30 -0700
Message-ID: <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 -- Received on Tue Jun 08 2004 - 22:01:30 CEST