473,378 Members | 1,434 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 5970
"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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.