473,503 Members | 722 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1158

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

Similar topics

15
2649
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
1089
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
2555
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
3018
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
1767
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
4422
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
547
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
383
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
2760
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
7089
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
7282
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,...
1
6995
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...
1
5017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1515
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.