Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
![](/static/devrant/img/pipeless-devrant-banner-white.png)
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
sboesch5465yDon't really have much experience in this field, but have you tried to EXPLAIN queries?
We once had an issue where we were lazy and queried SELECT * instead of SELECT field1, field2 in our client. But it was still fast. However, IIRC, the vendor added some binary fields in a later update, which made the whole thing brutally slow, of course. -
Check your indexes, as previously suggested use EXPLAIN, profile the consumer to see which queries are causing it and take a look at tools like newrelic, they have some analysis and stuff in it that can be pretty useful.
-
Developed an invoicing tool once and there was a missing index on the state of the invoice which was queried a lot.
Got the query time down from 10 seconds to about 20 milliseconds.
The amount of data was the cause. It worked fine for 2 years and suddenly it became incredibly slow. -
Thanks all. I'm pretty confident the SQL is ok, one project that takes nearly 2 minutes to load 1900 rows of time through the application, but the query in SQL completes in less than a second. But I will take another look at the indexes etc.
Unfortunately we don't have anything like New relic etc. -
How are you calling into the SQL? Are you holding the result set cached? Are you pulling the entire datasets just to grab a subset after (e.g. pagination in code but not in SQL)? Are you properly closing your connections? Had a similar problem years ago and it turned out we were not caching the data and kept calling full result sets and paginating in code. This would not have been a problem if we were caching the data, but we weren't. We were querying the entire data set each time we changed pages.
-
I only read the first sentence, but you keep the bus over 50 mph or it explodes. That’s how Keanu handled his speed issue anyways
-
Thanks all, did further investigations, indexes etc were all good, but I'd decided to do some comparisons against a previous version of the program running against the old dB server.
It looks like upgrading SQL fixed some other issues with slow running queries, so now we are left with the fact that the way the program is written isn't very efficient
How do you diagnose speed issues?
I've been lumped with looking after a legacy app.
It connects to our ERP system to handle raising invoices etc. And in June is developed slowness, which we sort of fixed by making one section load later (the SQL was a horrible view in a view in a view).
We then upgraded our ERP software, and the SQL issues are resolved (had to upgrade SQL server etc at the same time) and now the legacy app is running really slowly.
I know that it is when it loops through a data set to set column values etc.
A particular project has 1900 time transactions and takes upto 2 minutes to load.
This part of the program hasn't been changed in over a year, and has only started running slowly since the upgrade.
Are there any good way I can investigate and diagnose exactly why it has suddenly started running slowly?
question