473,471 Members | 1,684 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Sorting on NUMBER or DATE

Which is more expensive (slower), sorting data using NUMBER field or
using DATE field....
And how much more expensive?

Tomy.
Jul 19 '05 #1
3 5975
"Tomislav Petrovic" <t.********@inet.hr> wrote in message news:<ca**********@garrison.globalnet.hr>...
Which is more expensive (slower), sorting data using NUMBER field or
using DATE field....
And how much more expensive?

Tomy.


Considering that dates are internally stored as numbers, it would be
difficuly to tell the difference.

IF your concern really is the performance, then make a benchmark test
on Your hardware with Your data. Because in performance issues there
are only guidelines, no hard rules. And keep in mind that your test
data better be very close to real data or your production performance
could differ from your test performance. And usually not on the better
side of the line 8^)

hth,
Ed
Jul 19 '05 #2
"Tomislav Petrovic" <t.********@inet.hr> wrote in message news:<ca**********@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 --
Jul 19 '05 #3

"Mark D Powell" <Ma*********@eds.com> wrote in message
news:26**************************@posting.google.c om...
| "Tomislav Petrovic" <t.********@inet.hr> wrote in message
news:<ca**********@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
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: p0wer | last post by:
Let's suppose I have this sample document: <root> <entry id="1" <date>2003-08-03</date> <param_1>5</param_1> <param_2>10</param_2> </entry> <entry id="2"> ...
3
by: Raghuram Banda | last post by:
Hi, I was strucked in a problem, basically I'm working on Sortable Table and the table is created using HTML Tags and one of the fields in the table contain Date in unix format (something like...
22
by: mike | last post by:
If I had a date in the format "01-Jan-05" it does not sort properly with my sort routine: function compareDate(a,b) { var date_a = new Date(a); var date_b = new Date(b); if (date_a < date_b)...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
18
by: Scott | last post by:
I have a collection where the items in the collection are dates. I want to iterate over the collection and build a value list string for the rowsource of a listbox. The dates in the collection are...
7
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the...
1
by: John A Grandy | last post by:
In regard to a GridView that must support searching, filtering, sorting, and paging ... There is a tradeoff in performing the sorting and paging in the database versus to creating a CLR sort...
3
by: nagmvs | last post by:
Hi to all I have one table with 6 columns and 20 rows.I want to sort each and every column when i click the column name in the table. for sorting i create one more page.when i click the column...
5
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.