jeudi 5 novembre 2015

Which Sql statement perform fast?

Which of the following query will take much time?

Insert into table_name ('sfs',3,2,2),('sfe',3,2,2),('sf',3,2,2),('sf',3,2,2)('sf',3,2,2),('sf',3,2,2)
or
Insert into table_name select ('sfs',3,2,2) union all select ('sfe',3,2,2) union all select ('sf',3,2,2) union all select('sf',3,2,2)('sf',3,2,2) union all select('sf',3,2,2)

Is it right second query will be faster than first one ? Please some one give me brief explanation how both queries will work

Aucun commentaire:

Enregistrer un commentaire