I have a table like this: the goal is to query how many products have been sold per day, so the query is: The output is: Ok. Now let us suppose we have a scenario with several records and this query has to be run several times per day, we need to care about performance now in order to retrive
Tag: performance
Is it possible to get this PostgreSQL query down from 50ms to the order of a few ms?
I have a query that I want to make as fast as possible. It’s this: I get the following plan: Which is not terrible, I guess. But the actual query is more involved + I’ll be running this query in parallel on different shards. So I’m really focussed on getting this lightning quick. Is there anything I’m missing, or is
MySQL DATEDIFF function VS compare INTERVAL DAY
What is the difference between DATEDIFF function and subtract INTERVAL DAY directly? SELECT * FROM table WHERE DATEDIFF(CURDATE(), publish_date) = …
SQL Join – Limit to base table
I have 4 tables that I want to link together based on the information in the sales_details table which will serve as the base table (limiting results based on the sales_details table) 1)I want to pull all columns from the sales_detail table that are mastercard orders but since the sales_detail table doesn’t have a column to identity the type of
Optimising query with multiple selects as columns
I have a query I made: The results table has 25000 entries and it takes around 7 seconds to do this query, which is far too long. The query is incredibly inefficient as each column I’m creating is searching again on the same table but with different conditions. I tried indexing the columns of interest in my where clause. This
Trying to work out why my query is sluggish
So I have this query in C#, it takes about 3.6 seconds to complete. Here is both table designs Product review table: Review Table: I did have my where clause like so, but made no difference: I’m not sure why it’s slow, does anyone have advice to speed it up? Thanks More Info: Both tables have 6069 rows I have
Querying case-insensitive columns by SQL in Tarantool
We know that string Tarantool indices can be made case-insensitive by specifying the collation option: collation = “unicode_ci”. E.g.: t = box.schema.create_space(“test”) t:format({{name = “id”, …
One large DB request plus many Casts vs. many single DB requests – which is faster for a lot of Data [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago. Improve this question let’s say you have 5 concrete classes implementing the interface IResult. And you want to work with many diffrent concrete objects
Amazon RDS – Postgres not using index for SELECT queries
I have a feeling I am doing something terribly wrong but I can’t seem to figure it out. I have the following query which I am trying to execute: Also, I have an index on day, month, year which I had set up using the following command Now I figured the setting to set sequential scan on/off and tried playing
Does adding the guaranteed where condition on sql can improve performance?
Let’s say there’s a table about logging website access. (id is the only index column) | id | domain | logged_at | |—-|————|————————–| | 1 | yahoo.com |…