New answers tagged execution-plan
2
votes
Hash join hint returns an error when using local variable
Your query:
DECLARE @Id INT = 18471
SELECT c.UserId FROM dbo.Comments AS c
INNER HASH JOIN dbo.Users AS u
ON c.UserId = u.Id
AND c.UserId = @Id
has c.UserId = u.Id and AND c.UserId = @Id.
By ...
-1
votes
Accepted
Unstable plans when two first index columns have NULL values in all rows
I hate to approve my own answers, but this time I think I got it right.
After 3 days of tinkering with this issue I came to the conclusion that SQL Server gets lost with single-step statistics. After ...
3
votes
Unstable plans when two first index columns have NULL values in all rows
You can create a partial index with only the NOT NULL values:
create index ix_test on t1 (c2, c3, c4, ID) where c2 is not null and c3 is not null;
This index will be extremely small (and fast) and ...
8
votes
Unstable plans when two first index columns have NULL values in all rows
-- When you check the stats histogram, there's none.
That's a bug in sys.dm_db_stats_histogram. DBCC SHOW_STATISTICS shows the NULL row correctly (this is what SSMS uses). The original problem with ...
1
vote
Inconsistent query planners between two Postgres 16.4 instances
I can't read Dalibo's plan obfuscator, but in the raw output we can see the difference.
Slow:
-> Index Scan using stations_pkey on stations s (cost=0.28..177.61 rows=14 width=347) (actual time=...
1
vote
Sqlite fetching speed problem - how to understand explain and compare two queries
I would like to understand the different query plans and how to measure the execution speed and also the "math" reason why one query is faster then the other. Also what am i doing wrong?
I ...
Top 50 recent answers are included
Related Tags
execution-plan × 1205sql-server × 723
performance × 312
query-performance × 293
postgresql × 238
optimization × 166
index × 122
sql-server-2016 × 84
sql-server-2014 × 76
sql-server-2012 × 74
postgresql-performance × 67
t-sql × 53
mysql × 49
oracle × 46
sql-server-2008-r2 × 46
statistics × 42
plan-cache × 40
index-tuning × 36
cardinality-estimates × 36
sql-server-2019 × 35
explain × 34
sql-server-2008 × 33
join × 32
stored-procedures × 29
azure-sql-database × 28