Question : I have two Servers A and B with the same settings, but on Server A, the query runs […]
Category: Query Performance
Why does this query take 32 sec to execute?
Question : I keep my history records in one table and my pertinent data in another. I want to grab […]
Advice on how to improve the efficiency of a stored procedure using lots of joins
Question : I have a stored procedure that is returning search results for items in a database grouped by customers […]
Indexing a view with an averaged column
Question : With Sql-Server, I create this view: IF OBJECT_ID (‘dbo.v_table’, ‘view’) IS NOT NULL DROP VIEW [dbo].[v_table]; GO CREATE […]
Summing a column based on uniqueness of another column without using temporary table
Question : I have a table like this: CREATE TABLE `files` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT […]
Query with EXISTS-subquery taking about 280 ms in 80 % of cases, and less than 1 ms in 20 % of cases
Question : I noticed a query that seemed to take way too long most of the time, so I investigated […]
Order of operation with LTRIM/RTRIM/ISNULL
Question : Does the order of operation that you place your LTRIM and RTRIM matter when used in conjunction with […]
Best database design for website ranking
Question : I am working on a project in which I need to rank websites in two way – Global […]
How to improve multiple case when query performance?
Question : I have the following query which counts when the event_time is equal to the day of the month. […]
Huge data and performance in SQL Server
Question : I’ve written an application with a SQL Server backend that collects and stores and extremely large amount of […]