Home > Backend Development > PHP Tutorial > How to sort millions of data in php+mysql_PHP tutorial

How to sort millions of data in php+mysql_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 10:26:59
Original
1130 people have browsed it

How to sort millions of data in php+mysql?

 php+mysql million-level data paging. Because it involves joint queries with multiple tables and multiple conditions. Can anyone help optimize the following query statement?

 if(empty($wheresql)){

 $wheresql="where aid>=(SELECT aid FROM `tj_logs` LIMIT $sqlfirst,1) limit $shownu";

 }else{

 $wheresql.=" and aid>=(SELECT aid FROM `tj_logs` LIMIT $sqlfirst,1) limit $shownu";

 }

 $query=mysql_query("SELECT DISTINCT A.*,B.url,C.username FROM `tj_logs` A LEFT JOIN `tj_domain` B ON A.wid=B.wid LEFT JOIN `tj_members` C ON A. uid=C.uid $wheresql");

 ------Solution--------------------

In a sense, you should adopt redundant design to exchange redundancy for efficiency. This is the so-called anti-paradigm design

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/820424.htmlTechArticleHow to sort million-level data with php+mysql? Paging of million-level data with php+mysql. Because it involves joint queries with multiple tables and multiple conditions. Can anyone help optimize the following query statement? if(empty($wheresql)){ $wher...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php - mysql monitoring problem
From 1970-01-01 08:00:00
0
0
0
PHP toolbox mysql cannot start
From 1970-01-01 08:00:00
0
0
0
How to upgrade mysql in php toolbox
From 1970-01-01 08:00:00
0
0
0
Can the php toolbox change the mysql version?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template