473,396 Members | 2,038 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,396 software developers and data experts.

performance question: resultset's vs sql

Does anyone know what the relative performance would be of using updateable
result sets versus using individual insert or update statements?
(Specifically at the moment I'm dealing with JSP programs using J/Connector
on Tomcat, if that matters.) For example, if I want to read ten records and
update them, would I be better off to use an updateable result set and
update each as I go, or to issue UPDATE statements for each? (Intuitively it
seems to me that the ResultSet should be faster, but who knows?) Similarly,
if I want to insert 10 records, would I be better off to issue 10 INSERT
calls, or to create an empty Result Set and then add records to it?

Another efficiency question: I'm working on a JSP program where I build a
display based on a select, the user fills in some fields that relate to each
record, and then when Submit is pressed I re-read the records and do my
processing. I was just assuming because it sounded right to me that I am
better off to SELECT all the records, get the result set back, and then loop
through, matching the records read against the fields off the web form, and
whenever I see that I have to do something, I go off and do it (updating
various tables based on input). But it occurs to me that an obvious
alternative, and easier to code, would have been to loop through the web
form fields, for each do a select that retrieves that one record, and then
process it. That is, it seems to me intuitively that I am better off to do
one select that retrieves 100 records and loop through the result set
processing them, rather than to do 100 queries that each retrieve 1 record.
Is this true?

Thanks for any help!

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
0 1085

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

Similar topics

15
by: Good Man | last post by:
Hey there I have a dumb question.... Let's say i have a database full of 4000 people.... I select everything from the database by: $result = mysql_query("SELECT * FROM People");
0
by: RoyalScorpion | last post by:
hi guys, i get an updatable resultset from a connection then used it to insert a new row but the result set doesn't chane after insertion, i mean the no of rows before insertion is the same after...
0
by: Mark Jay Johansen | last post by:
Does anyone know what the relative performance would be of using updateable result sets versus using individual insert or update statements? (Specifically at the moment I'm dealing with JSP...
1
by: Raquel | last post by:
Have a question on the Stored procedure method code generated by DB2 development center for Java stored procedures. Suppose I have a requirement to return the resultset consisting of FIRSTNME,...
4
by: bala | last post by:
hi!!! the following is the sql which is veri slow cos of the 'Not In' clause, would appreciate if u anyone can suggest any other way to bring about the same result SELECT Id, LOC, AGENCY,...
4
by: Bob Alston | last post by:
Some more, rather specific Access performance questions. IN a split front-end & back-end Access/Jet ONLY LAN situation, and with all query criteria fields and join fields indexed: 1. Is is...
4
by: _link98 | last post by:
Problem: java ResultSet cursor from SQL/PL stored-procedure is FORWARD_ONLY. Is it possible to have ResultSet cursors from SQL/PL procedures to scroll forward and backwards? Perhaps I am missing...
1
by: Phil | last post by:
Hello, I'm trying to get the result of a set intersection and I'm sure that I've made a very basic error. A Google search has helped but I'm still not quite there. Can someone show me the...
4
by: bobiron | last post by:
Hi, any ideas to improve the above ugly and not efficient code? Thanks Roberto <!-- source XML NOTE: elements "col" changes from source to source --> <?xml version="1.0"?> <resultset>...
2
by: sdanda | last post by:
Hi , Do you have any idea how to improve my java class performance while selecting and inserting data into DB using JDBC Connectivity ......... This has to work for more than 8,00,000...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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,...

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.