Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Mysql Slow "SHOW TABLE STATUS FROM"

Posted on 2011-02-12
5
1,797 Views
Last Modified: 2012-06-27
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



0
Comment
Question by:lnrivera
  • 3
  • 2
5 Comments
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 500 total points
ID: 34880399
the vb.net code is likely having the abstraction layer that is first looking at the table meta data information before actually running the query ...
0
 

Author Comment

by:lnrivera
ID: 34880412
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...
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 34882406
you probably have plenty of tables in your database, right?
anyhow, can  you please show the relevant .net code?
0
 

Author Comment

by:lnrivera
ID: 34882432
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
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 34884025
can you please check which value this property has on the data adapter (MissingSchemaAction):
http://msdn.microsoft.com/en-us/library/system.data.common.dataadapter.missingschemaaction.aspx

it shall be "Add" by default, you might consider to change to ignore, and create the data table configuration explicitly before filling it from the data adapter
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mysql database, schema and table creation 13 57
Help with preventing selection from a combobox 11 34
Visual studio 2015 1 22
check mysql insert 12 27
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question