php+mysql百万级数据如何排序?
php+mysql百万级数据分页。因涉及多表多条件联合查询。谁能帮忙优化下面的查询语句。
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");
------解决方案--------------------
某种意义上说,你应该采取冗余设计,以冗余换效率,这就是所谓的反范式设计

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 English version
Recommended: Win version, supports code prompts!

Dreamweaver CS6
Visual web development tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft