Home > database >  SQL statements optimization problem, ask for help
SQL statements optimization problem, ask for help

Time:09-28

SELECT the DATE (del_sendmsg_records send_date) AS oneday, del_branchs. Name AS del_branch_name, del_branchs. Shortname AS del_branch_shortname, COUNT (*) AS number
The FROM del_sendmsg_records
The JOIN del_branchs
ON del_sendmsg_records. Del_branch_id=del_branchs. Id
WHERE del_sendmsg_records. Sended=1
GROUP BY oneday, del_sendmsg_records del_branch_id


It should be how to optimize visual because the slow WHERE del_sendmsg_records. Sended=19 (sendedtinyint whether (1) NOT NULL sent, 0 NOT to send, send 1) how to optimize

CodePudding user response:

CodePudding user response:

Associative table on the order of the grouping field order for establishing a composite index (sended del_branch_id) let's try look have the effect to normal should be get a TAB

CodePudding user response:

Set the table alias you give it a try
  • Related