Link to home
Start Free TrialLog in
Avatar of Luis N
Luis NFlag for Spain

asked on

Mysql Slow "SHOW TABLE STATUS FROM"

I'm checking the slow query log, and I found this:

I have a Mysql Server 5.5 and In VB.NET when launch a query like "SELECT * from exampletablename1 " always in the mysql slow log i found this slow query "SHOW TABLE STATUS FROM database like 'exampletablename1'

I don't understand why a "select *" generate the "show table status from..., but in any case, I'm sure that the "SHOW TABLES STATUS" are a slow query

Why? and how can I solve it

Regards



SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Luis N

ASKER

I'm agree, but the problem is that SHOW TABLE STATUS FROM tablename when I use a innodb table take more than 1 minute to return the results...
you probably have plenty of tables in your database, right?
anyhow, can  you please show the relevant .net code?
Avatar of Luis N

ASKER

In the beginning I supose that the "select *" generated the problem, but I did a deep analyse, and I found that the show table status are generated always that I include in the select sentence the primary key field. If I launch a select query that doesn't have the primary key field included, the mysql adaptar doesn't generate the show table status before
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial