mycli icon indicating copy to clipboard operation
mycli copied to clipboard

Slow query - not due to pager.

Open sgorange opened this issue 4 years ago • 1 comments

Hey, there seems to be a problem of slow queries not related to pager. I also tested with mariadb 10.4.xx with the same results.

Here are some details : With mycli:

MariaDB 10.3.34
mycli 1.24.1
Home: http://mycli.net
Bug tracker: https://github.com/dbcli/mycli/issues
Thanks to the contributor - Heath Naylor
MariaDB groot@localhost:(none)> use mydb;
You are now connected to database "mydb" as user "groot"
Time: 0.001s
MariaDB groot@localhost:mydb> select * from customer
110016 rows in set
Time: 119.905s
MariaDB groot@localhost:mydb> pager pspg -s 5
PAGER set to pspg -s 5.
Time: 0.001s
MariaDB groot@localhost:mydb> select * from customer
110016 rows in set
Time: 121.547s

With mysql:

MariaDB [mydb]> select * from customer;
110016 rows in set (0.224 sec)
MariaDB [mydb]> desc customer;
15 rows in set (0.001 sec)

| Field           |      Type        | Null | Key | Default |     Extra      |
+-----------------+------------------+------+-----+---------+----------------+
| id              | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| username        | varchar(60)      | YES  | UNI | NULL    |                |
| password        | varchar(64)      | YES  |     | NULL    |                |
| civility        | smallint(6)      | NO   |     | 0       |                |
| lastname        | varchar(100)     | NO   |     | NULL    |                |
| firstname       | varchar(100)     | NO   |     | NULL    |                |
| homephone       | varchar(16)      | YES  |     | NULL    |                |
| cellphone       | varchar(16)      | YES  |     | NULL    |                |
| alert_comment   | varchar(255)     | YES  |     | NULL    |                |
| visible_comment | varchar(255)     | YES  |     | NULL    |                |
| cuac_id         | int(11)          | YES  |     | NULL    |                |
| token           | varchar(32)      | YES  |     | NULL    |                |
| active          | tinyint(1)       | NO   |     | 1       |                |
| is_key_account  | tinyint(1)       | NO   |     | NULL    |                |
| outstanding_max | decimal(20,3)    | YES  |     | NULL    |                |
+-----------------+------------------+------+-----+---------+----------------+

sgorange avatar Mar 17 '22 06:03 sgorange

Closing since the table scan looks like it is just a slow query. Perhaps it is faster sometimes due to caching.

rolandwalker avatar Dec 30 '25 19:12 rolandwalker