How to troubleshoot/debug a MySQL slow query? [closed] - mysql

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
If you have a slow SQL query, how do you debug it?
Where do you start and what are the steps needed to identify the problem?
I'm new to this subject and searching online wouldn't give me a clear idea how to start.

Your best tool is to look at the execution plan. On a high level, the execution plan shows how the query is executing, and what parts of the query take more processing relative to the other parts. This is the best anyone on this site would be able to do for you without seeing the query, and the execution plan for that matter. There are so many things that could be causing the problem.
Here are a few references (depending on what version of MySQL you are in)-
http://dev.mysql.com/doc/refman/5.5/en/execution-plan-information.html
http://dev.mysql.com/doc/refman/5.0/en/execution-plan-information.html

Related

How does MySQL do I/O? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed last year.
Improve this question
I was wondering how MySQL (and other databases for that matter) work under the hood. Do they use standard C I/O calls like fseek to find a record?
Here is the link to the source code. From a quick review of the file I can confirm that there are multiple check that is been done before and after an insert. It's actually a great idea to review the whole file very interesting.

What is faster / better? More SQL-Select statements or multiple detailed sql commands? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
i work on a project with node.js and a mysql database.
i have a connection between them with the npm modul mysql.
Now my question:
is it better to send a SQL command and sort the data in node.js or multiple detailed sql commands?
what is faster / more performant?
Thanks.
Without knowing the exact SQL queries, I would say that database operations are faster compared to your own implementation. Many smart people have worked to assure performance, accuracy, atomicity, concurrency etc. of the Mysql engine.
Even if you can gain marginal improvements in some aspect with your own code, it is unlikely that you will be able to justify the investment.

How to deliver new features (Website) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have recently been thinking about one of my websites. It's getting big and gaining a community and I have realized; how would I implement new features. Would I code instantly on the website or would I have to pull a backup and code on it then put it back up on the server. Because both methods seem to be inefficient.
Would there be a way that I can do such a thing, like a version system (similar to apps)?
Create a duplicate, test your code until you're satisfied. Check the edge cases. Try to break it. Then, when you're sure it's solid, roll it out to your users during very light usage because you might need to turn off the whole site during the upgrade.
Testing, testing, testing is they key.

Joining a view using an existing view in mySQL [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I created a table view and joined it to an existing view. Is this a good way?
I'm wondering when the rows in the table piles up, will the performance be affected?
What are the other possible problems that I will encounter when I do this?
It is hard to say whether this way is good or not. It depends on your database design. Views have some advantages, so if you need to use views, then use them. But views may have bad performance, have a look at this article - MySQL VIEW as performance troublemaker.

How do I stop a query within workbench? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
We are sorry for the inconvenience but an unexpected exception has been raised by one of the MySQL Workbench modules. In order to fix this issue we would kindly ask you to file a bug report. You can do that by pressing the [Report Bug] button below.
Please make sure to include a detailed description of your actions that lead to this problem.
Thanks a lot for taking the time to help us improve MySQL Workbench!
The MySQL Workbench Team
Do you mean stop a query within workbench? If so: