Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 25. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Optimized UPDATE Request?

phpMyEdit General     Optimized UPDATE Request?
Odoslať novú tému   Odpovedať na tému    
 
patricek_97     Založený: 21.11.2007   Príspevky: 5  
Príspevok Zaslal: 2007-11-21 20:09
Návrat hore  Odpovedať s citátom     

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     Založený: 17.06.2003   Príspevky: 537   Bydlisko: Slovakia
Príspevok Zaslal: 2007-11-25 16:23
Návrat hore  Odpovedať s citátom     

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     Založený: 21.11.2007   Príspevky: 5  
Príspevok Zaslal: 2007-11-25 16:30
Návrat hore  Odpovedať s citátom     

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     Založený: 17.06.2003   Príspevky: 537   Bydlisko: Slovakia
Príspevok Zaslal: 2007-11-25 16:39
Návrat hore  Odpovedať s citátom     

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     Založený: 21.11.2007   Príspevky: 5  
Príspevok Zaslal: 2007-11-26 20:17
Návrat hore  Odpovedať s citátom     

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.

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov