开发者

How to disable or circumvent phpmyadmin's SQL_CALC_FOUND_ROWS

When you process开发者_Python百科 a SELECT through phpmyadmin, behind the scenes, it will sometimes add a LIMIT 0,30, and/or it'll throw a SQL_CALC_FOUND_ROWS into the SELECT so it can tell me how many results there would have been without the LIMIT.

Unfortunately, adding the SQL_CALC_FOUND_ROWS sometimes requires much more processing than I was expecting (i.e. more than if I had ran my original untainted query).

Is there a global config option to disable phpmyadmin's modification(s) of my queries?

What tricks can I use on a per-query basis to prevent phpmyadmin's modification(s)?


A quick check of the PHPMyAdmin source code says there isn't one.

However, if you look in the file sql.php, and find the else statement labelled // n o t " j u s t b r o w s i n g ". Replace the code between there and // end else "just browsing" with something like $unlim_num_rows = 1000000; you'll prevent it doing its counting query, while still being able to browse.

(you'll have to repeat this each time you update PMA, which you should be doing regularly since its security reputation is not great, to say the least)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜