Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, March 29, 2024
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Optimized UPDATE Request?

phpMyEdit General     Optimized UPDATE Request?
Post new topic   Reply to topic    
 
patricek_97     Joined: 21 Nov 2007   Posts: 5  
Post Posted: 2007-11-21 20:09
Back to top  Reply with quote     

Does phpMyEdit send optimized SQL Update request?

In other words, the UPDATE request only includes the fields that have been modified in the form or all the fields are included?

#1 UPDATE t SET f1=v1, f2=v2, f3=v3 WHERE id=x
#2 UPDATE t SET f3=v3 WHERE id=x

 
michal     Joined: 17 Jun 2003   Posts: 537   Location: Slovakia
Post Posted: 2007-11-25 16:23
Back to top  Reply with quote     

there is an extra select query to determine which values are changed (see $changed array available in triggers), so the query should be optimized (imho it is)

 
patricek_97     Joined: 21 Nov 2007   Posts: 5  
Post Posted: 2007-11-25 16:30
Back to top  Reply with quote     

If a SELECT request is sent before the UPDATE, I can't say it's optimized...

IMHO, phpMyEdit should find the fields that have been edited and build the UPDATE request based on those fields.

 
michal     Joined: 17 Jun 2003   Posts: 537   Location: Slovakia
Post Posted: 2007-11-25 16:39
Back to top  Reply with quote     

the problem is how you find which fields are changed. current way is to do extra select query and compare the two. (other way would be to somehow remember it from the previous page). the difference is dealing with situation when two people are editing the row in same time (like: select, select, update, update). currently, the last one takes all.

 
patricek_97     Joined: 21 Nov 2007   Posts: 5  
Post Posted: 2007-11-26 20:17
Back to top  Reply with quote     

I propose to save the original values (maybe with hidden fields). Only fields that have been changed would be sent to MySQL... My 2c.

BTW, phpMyAdmin does that.

 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy