Question : An example from this question shows that SQL Server will choose a full index scan to solve a […]
Category: Database Optimization
Why does `SELECT count(*)` return 1?
Question : Some RDBMS’s seem to allow a query without a FROM clause, eg: postgres=# SELECT ‘foo’ bar; ┌─────┐ │ […]
What strategy does MySQL optimizer use when choosing between two indexes?
Question : In question: Optimize a query with two range conditions the OP wanted to know if there were a […]
primary key constraint Sorting
Question : Is having a field in primary key constraint optimizes sorting of the table ? Here’s the schema of […]
Maximum possible memory usage: 16.2G (874% of installed RAM)
Question : Why the MySQL is saying that can use about 16GB of RAM even if my server has only […]
Explanation for second Compute Scalar
Question : I noticed a peculiar thing. This query declare @t int = 3; select distinct top(@t) Number – Number […]
Is there anything I can do to optimise this complex query?
Question : I have a rather complex query that spans several layers of subqueries, the two primary ones fetching data […]
Multiple query to columns indexed in MySql
Question : I am trying to make a table with server-side page, so it can also apply filters for each […]
Extremely slow DB query even after increasing CPU and RAM of Droplet
Question : I have a single database query which runs when a user searches a product on my site. I […]
status table join slows down query by 10 seconds
Question : Got an issue with a fair few queries in our system that all rely on a status table […]