Guest User

Untitled

a guest
Jan 10th, 2018
476
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mysql> explain SELECT DATE(t1.starttime) AS day, sum(t1.sessiontime) AS calltime, sum(t1.sessionbill) AS cost, count(*) as nbcall,             sum(t1.buycost) AS buy, sum(case when t1.sessiontime>0 then 1 else 0 end) as success_calls                 FROM cc_call t1 LEFT OUTER JOIN cc_trunk t3 ON t1.id_trunk = t3.id_trunk                 LEFT OUTER JOIN cc_ratecard t4 ON t1.id_ratecard = t4.id                 WHERE t1.starttime >= ('2017-12-1') AND t1.starttime <= ('2017-12-31 23:59:59')                 AND  (t1.terminatecauseid=1)  GROUP BY day ORDER BY day;
  2. +----+-------------+-------+------------+--------+----------------------------------------------------+-----------+---------+--------------------------+---------+----------+---------------------------------------------------------------------+
  3. | id | select_type | table | partitions | type   | possible_keys                                      | key       | key_len | ref                      | rows    | filtered | Extra                                                               |
  4. +----+-------------+-------+------------+--------+----------------------------------------------------+-----------+---------+--------------------------+---------+----------+---------------------------------------------------------------------+
  5. |  1 | SIMPLE      | t1    | NULL       | range  | starttime,terminatecauseid,cc_call_agent_starttime | starttime | 4       | NULL                     | 6991344 |    50.00 | Using index condition; Using where; Using temporary; Using filesort |
  6. |  1 | SIMPLE      | t3    | NULL       | eq_ref | PRIMARY                                            | PRIMARY   | 4       | a2billing.t1.id_trunk    |       1 |   100.00 | Using index                                                         |
  7. |  1 | SIMPLE      | t4    | NULL       | eq_ref | PRIMARY                                            | PRIMARY   | 4       | a2billing.t1.id_ratecard |       1 |   100.00 | Using index                                                         |
  8. +----+-------------+-------+------------+--------+----------------------------------------------------+-----------+---------+--------------------------+---------+----------+---------------------------------------------------------------------+
  9. 3 rows in set, 1 warning (0.19 sec)
RAW Paste Data