SELECT the title, id, every, titlepic FROM push_log_0 BETWEEN (UNIX_TIMESTAMP (NOW ()) - (24) (3600 * * 30)) AND UNIX_TIMESTAMP (NOW ()))
The UNION
SELECT the title, id, every, titlepic FROM push_log_1 BETWEEN (UNIX_TIMESTAMP (NOW ()) - (24) (3600 * * 30)) AND UNIX_TIMESTAMP (NOW ()))
The UNION
SELECT the title, id, every, titlepic FROM push_log_2 BETWEEN (UNIX_TIMESTAMP (NOW ()) - (24) (3600 * * 30)) AND UNIX_TIMESTAMP (NOW ()))
The UNION
SELECT the title, id, every, titlepic FROM push_log_3 BETWEEN (UNIX_TIMESTAMP (NOW ()) - (24) (3600 * * 30)) AND UNIX_TIMESTAMP (NOW ()))
The UNION...
Like this UNION query result of mysql view was founded after the connection is slow,, please give a optimization scheme, thank you,
CodePudding user response:
After using union all connections, the union connection, connection will also perform to heavy operationCodePudding user response:
The union would use the sort, to go toLook at the query plan, analyze whether can walk index
CodePudding user response:
1/f, the great god to reply a little bit, still can be optimized for 2 seconds, but now the query speed in the 4 to 5 seconds, speed or not, everyone is there some other solutions,CodePudding user response:
Post the explain the select... For analysis,CodePudding user response:
I directly in the or, in, and the condition, the union of a batch of slowCodePudding user response:
"How to implement window functions to assist the MySQL" this article introduces the method, can realize the union query, good problem solving and performanceCodePudding user response:
You put the where condition, into a fixed value, don't use function, first try, whether to change quickly?