Skip to content
Advertisement

Tag: query-optimization

Select distinct very slow

I have a table where I store rows with external ids. Quite often I need to select latest timestamp for given external ids. Now it is a bottleneck for my app Query: Explain: What could I do to make this query faster? Or probably should I use completely different query? UPDATE: Added new query plan as asked @jahrl. It looks

Slow Querying DB

I am currently optimising a system with many connected tables. The part that I am working on right now is displaying table orders. The problem is that in this table there are also many relations (around 10) which I am querying. The problem itself is in querying that many relations. I have been using Eloquent + with() methods for eager

How can I replace this correlated subquery within a function call?

Given the following tables buckets points And the following query Output How can I remove the correlated sub-query to improve the performance? Currently ~280,000 points * ~650 buckets = ~180,000,000 loops = very slow! Basically I want to remove the correlated sub-query and apply the width_bucket function only once per unique metric_id in buckets, so that the performance is improved

MariaDB Created view takes too long

I have a problem. I have a table with 6 million records in it. Every record has a column dateTime, and for my code I need the most recent 16 records in ascending order. This took too long to query directly out of the original table, so I created a view using the following query: This means that the view

How to improve a mysql COUNT query for speed?

How can I improve this query for speed? at the moment it’s taking a couple of seconds only to load the php file where the query is without even querying anything. I’ve an index on skillsTrends, jobtitle and industry. Collation: utf8mb4_unicode_ci Number of records < 1,000,000. Answer Try this covering index. It should help the performance of your query. And,

Advertisement