Php+mysql millions data How to sort _php tutorials

Source: Internet
Author: User
Php+mysql Millions How is the data sorted?

Php+mysql millions data paging. Multiple-table multi-Conditional union queries are involved. Who can 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 in A.wid=b.wid left join ' Tj_members ' C on A.uid=c.uid $wheresql ");

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

In a sense, you should take redundant design to redundancy for efficiency, which is called inverse paradigm design

http://www.bkjia.com/PHPjc/820424.html www.bkjia.com true http://www.bkjia.com/PHPjc/820424.html techarticle Php+mysql Millions How is data sorted? php+mysql millions data paging. Multiple-table multi-Conditional union queries are involved. Who can help optimize the following query statement. if (empty ($wheresql)) {$wher ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.