1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 01:24:17 +02:00

Fast number of rows with big tables in PostgreSQL (thanks to juzna)

This commit is contained in:
Jakub Vrana
2011-07-29 17:08:06 +02:00
parent 2e1d38a920
commit c82829942c
7 changed files with 36 additions and 2 deletions

View File

@@ -373,8 +373,8 @@ if (!$columns) {
if ($rows || $page) {
$exact_count = true;
if ($_GET["page"] != "last" && +$limit && count($group) >= count($select) && ($found_rows >= $limit || $page)) {
$found_rows = $table_status["Rows"];
if (!isset($found_rows) || $where || ($table_status["Engine"] == "InnoDB" && $found_rows < max(1e4, 2 * ($page + 1) * $limit))) {
$found_rows = found_rows($table_status, $where);
if ($found_rows < max(1e4, 2 * ($page + 1) * $limit)) {
// slow with big tables
ob_flush(); //! doesn't work with AJAX
flush();