Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>20 seconds is very weird for such a little table. I have a very similar table with almost 4 million rows and your both SQL statements takes less than 0.002 sec.</p> <pre><code>CREATE TABLE IF NOT EXISTS `tasks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `status` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'open', `method` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'GET', `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `params` text COLLATE utf8_unicode_ci, `response` text COLLATE utf8_unicode_ci, `executed_by` varchar(50) COLLATE utf8_unicode_ci DEFAULT '', `execute_at` datetime DEFAULT NULL, `created` datetime NOT NULL, `modified` datetime NOT NULL, PRIMARY KEY (`id`), KEY `status` (`status`), KEY `modified` (`modified`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3839270 ; </code></pre> <p>-</p> <pre><code>SELECT COUNT(id) FROM tasks WHERE status='done'; ---&gt; Query took 0.0008 sec </code></pre> <p>-</p> <pre><code>SELECT id, status, method, url FROM tasks WHERE status='done' ORDER BY id DESC LIMIT 200, 100; ---&gt; Query took 0.0011 sec </code></pre> <p>Observations:</p> <ul> <li>You should use SELECT COUNT(New_Id)...</li> <li>New_id &lt;> '' doesn't make sense. New_id can't be empty or NULL</li> <li>Set the length of New_Status to something that match the values you store there</li> <li>Try turning off logging: SET GLOBAL general_log = 'OFF';</li> <li>Update your server packages (specially MySQL)</li> <li>Is it a dedicated server only for the database?</li> <li>Is the server running other things? (run 'top' and 'uptime' to check it status)</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload