i working on mysql database innodb storage engine. table structure follows:
table name : archiveincomingsms

index detail of : archiveincomingsms

table name : archiveoutgoingsms 
index detail of : archiveoutgoingsms 
above table structure , index detail !
both table have minimum more 1 billion records(rows) respectively.
now problem when execute following sqlquery :
( select id id, `recieved_datetime` `date`, 'mt' type, src_adress msisdn, text text, char_length(text) qtyofsymbols, 'ok' `status` archiveincomingsms 1=1 , recieved_datetime between '2015-06-14 00:00:00' , '2015-07-14 23:59:59' ) union ( select id id, `send_date` `date`, 'mo' type, scr_adress msisdn, text text, char_length(text) qtyofsymbols, 'ok' `status` archiveoutgoingsms 1=1 , send_date between '2015-06-14 00:00:00' , '2015-07-14 23:59:59' ) order `date` asc limit 0 ,100 above query takes more 30 second time data tables. , 1 have count number of row pagination purpose , take more 30 second time.
overall takes more 1 minute execute. there proper way optimize time ? have take down maximum 5 sec. ! how can possible ? using mysql database !
here result of query explain !
image can view open in new tab ! it's small here !
Comments
Post a Comment