English 中文(简体)
Mysql_CALC_FOUND_ROWS 页: 1
原标题:Mysql SQL_CALC_FOUND_ROWS and pagination

因此,我有一个略超过500万的桌子。 当我使用时 que。 当我去除问询时,我是在第二次与LMIT25见面时。 我的问题是,出于想象原因,除了增加总行数之外,还有其他选择?

最佳回答

SQL 迫使MySQL冲锋枪,即使他们从来都无法驾车。 从内部来看,这相当于在没有《利比里亚义务公约》条款的情况下执行的同一问题。

如果通过WHERE进行过滤的频率太高,你可以计算和收集各种过滤器,以节省cal-深层_子施加的全扫描负荷。 基本操作“当选数(*) 尽可能在......范围内适用......条款。

否则,你就能够进入谷歌式,只是抽出一些页数,有时与现实没有任何关系。 (你们知道,见“Goooooooooooogle”,第3页,突然脱离结果。)

问题回答

关于实施谷歌式,利用MySQL进行想象

页: 1 和_CALC_FOUND_ROWS,视具体情况而定。 如果您的查询标准使用指数中的数据――使用COUNT(*)。 在这种情形下,Mysql将“阅读”从指数中“阅读”,但不必触及表格中的实际数据,而LucalC_FOUND_ROWS方法将用磁盘中装上可能昂贵和耗费大量时间的电流。

http://www.mysql Performanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/“rel=”nofollow”>。





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签