MySQL Forums
Forum List  »  Performance

Re: innodb_checksum_algorithm stic_crc32 is slow response
Posted by: Rick James
Date: December 09, 2014 03:34PM

A bit more readable:
select  sql_no_cache CAST(trim(t.ticket_no) AS UNSIGNED) as ticket_no,
       CAST(trim(t.transaction_no) AS UNSIGNED) as transaction_no,
       ty.ticket_type_name, ifnull(tsy.ticket_sub_type_name,'') ticket_sub_type_name,
       t.schedule_no,t.route_no, ifnull(bs.bus_stop_name,' ') as from_stop_name,
       ifnull(bs2.bus_stop_name,' ' ) as till_stop_name, t.ticket_time,
        t.px_count, sum(t.px_total_amount) px_total_amount , t.lugg_units,
        sum(t.lugg_total_amount) lugg_total_amount,t.total_ticket_amount
    from  etim_gprs_ticket t
    left join  bus_stop bs on bs.bus_stop_id=t.from_bus_stop_id
    left join  bus_stop bs2 on bs2.bus_stop_id=t.till_bus_stop_id
    left join  ticket_type ty on ty.ticket_type_id=t.tkt_type_short_code
    left join  ticket_sub_type tsy on tsy.ticket_sub_type_code=t.tkt_sub_type_short_code
    inner join  device d on d.device_serial_number = t.etim_no
      and  d.status = 'ACTIVE'
      and  d.deleted_status = 0
    where  t.waybill_no='D1114120600086'
      and  t.trip_no='1'
      and  t.shift_no='2'
      and  t.ticket_date = '07-12-2014'
    group by  ticket_no
    order by  ticket_no , transaction_no;

This change may speed things up by folding the ORDER BY into the GROUP BY:
group by ticket_no
order by ticket_no , transaction_no;
-->
group by ticket_no , transaction_no
order by ticket_no , transaction_no;

Do EXPLAIN SELECT ...; on each machine -- you may find differences.

I would expect this to be the best index:
INDEX(waybill_no, ticket_date)
Perhaps you can show us the CREATE TABLEs?

`device` is a very small table? So its indexing does no matter much?

(I want to get these other issues out of the way before discussing CRC speed.)

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: innodb_checksum_algorithm stic_crc32 is slow response
987
December 09, 2014 03:34PM


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.