briedis Posted May 21, 2009 Report Share Posted May 21, 2009 Vai tas nekas, ja man kvērijā ir daudz OR'i? Nu teiksim, līdz pat 50 :) Vai ir kāds labāks veids, kā panākt to pašu efektu? (Man vajag update'ot ierakstus ar konkrētu vērtību kuriem id ir kāds no sarakstiņa(php masīvs). Quote Link to comment Share on other sites More sharing options...
bubu Posted May 21, 2009 Report Share Posted May 21, 2009 Īsāk to var pierakstīt ar IN. $ids = array(1, 2, 3, 50, 1251); $query = "SELECT * FROM Tabule WHERE id IN (" . implode(",", $ids) .")"; To, vai tas ir potenciāla performances problēma, tev izskaidros EXPLAIN keywords. Quote Link to comment Share on other sites More sharing options...
briedis Posted May 21, 2009 Author Report Share Posted May 21, 2009 Paldies Tev! Ļoti palīdzēji! Papētīšu to EXPLAIN :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.