MySQL Forums
Forum List  »  InnoDB

Re: Locking issue in innodb select query
Posted by: zafar malik
Date: August 14, 2013 01:14AM

>Can use the first one, but can't use the second.
>>Yes I agree and I am aware with index ordering, so in below query INDEX(CREATEDATE, PSTISCOMBO) should better work.
SELECT COUNT(smt.SMTNAME) AS countval, smt.SMTNAME AS statusname, SUM(psttab.PSTPAYABLEPRICE) AS priceval FROM (SELECT PSTPAYABLEPRICE, PSTSMTSTATUS, PSTISCOMBO FROM ISMPST WHERE CREATEDATE >= '2013-05-02' AND PSTISCOMBO = 'N') AS psttab JOIN ISMSMT AS smt ON psttab.PSTSMTSTATUS = smt.SMTRFNUM GROUP BY smt.SMTNAME;

>Suggest doing this (Need to update value ā€˜Nā€™ where it is NULL in PSTISCOMBO columns) before the ALTER:
>>any specific reason to update before alter.
>>>Also as this table contains huge data so I am planning to replace NULL with 'N' in only last 3 month data as query is fetching only 3 month data. Please suggest if you are seeing any issue in this.

>> Also Any clue regarding locking time in innodb select queries. May you help me in this.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Locking issue in innodb select query
955
August 14, 2013 01:14AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.