Yeah that's true I stand corrected... Our database is fairly local in a
central place on our private WAN and it runs at 100mb. We have two WebLogic
server clusters in different locations 60 miles apart and the database
server is in another location close to one of the Weblogic servers (a
couple of blocks away) and the response time is quick.

Greg.





"Cote, Robert" <[EMAIL PROTECTED]> on 2002/05/30 09:21:43 AM

Please respond to "JDJList" <[EMAIL PROTECTED]>

To:   "JDJList" <[EMAIL PROTECTED]>
cc:

Subject:  [jdjlist] Re: sorting records


Your system architecture should be considered as well.  If the database is
remote, and you don't have a lot of bandwidth, going back to the db may be
expensive.  If the database is local, having the db do the sort may be
faster.  As an earlier post mentioned, if you're really concerned, your
best
bet is to actually test it both ways, ideally under a reasonable system
load.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 30, 2002 8:53 AM
To: JDJList
Subject: [jdjlist] Re: sorting records



Greetings,

I have always used an 'order by' to do the sorting as I felt it was easier
to do it that way... Also depending on how the DBMS implements caching the
next time you fire off the query with a different 'order by' it will pick
up the same result set in memory from the previous query providing that
nothing else has changed in the rest of the SQL statement. I found it to be
quite quick using Oracle. Besides that's what a database does best is sort
records. You could probably do it by caching the result set using Value
objects in a Collection but I have never done it that way so I don't know
if there would be a performance advantage or not. It would certainly use
quite a bit of the Java heap so be prepared to increase the memory
requirements when you start the JVM.

HTH,
Greg.





"Repine, Burt" <[EMAIL PROTECTED]> on 2002/05/29 06:01:58 PM

Please respond to "JDJList" <[EMAIL PROTECTED]>

To:   "JDJList" <[EMAIL PROTECTED]>
cc:

Subject:  [jdjlist] sorting records


Hello all -

I have a requirement to retrieve n number of records from a database using
JDBC and then display those records to the user.
The user can then sort those records if they so choose.
Would it be faster/less resource intensive to go back to the database with
a
new 'order by' SQL statement OR sort the records as a Collection in the
Java
code?

Thanks for the help,
Burt



To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm







To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm







To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

Reply via email to