Required help to Increase the performance of the MySQL query

Posted by Joseph on Stack Overflow See other posts from Stack Overflow or by Joseph
Published on 2010-05-03T19:33:23Z Indexed on 2010/05/03 19:38 UTC
Read the original article Hit count: 280

Filed under:
|

Hi all,

I am using a following query in MySQl for fetching data from a table. Its taking too long because the conditional check within the aggregate function.Please help how to make it faster

SELECT testcharfield ,SUM(IF (Type = 'pi',quantity, 0)) AS OB ,SUM(IF (Type = 'pe',quantity, 0)) AS CB FROM Table1 WHERE sequenceID = 6107 GROUP BY testcharfield

© Stack Overflow or respective owner

Related posts about mysql

Related posts about Performance