All Questions
Tagged with sql sql-execution-plan
63
questions
381
votes
13
answers
513k
views
How do I obtain a Query Execution Plan in SQL Server?
In Microsoft SQL Server how can I get a query execution plan for a query / stored procedure?
12
votes
3
answers
35k
views
SQL poor stored procedure execution plan performance - parameter sniffing
I have a stored procedure that accepts a date input that is later set to the current date if no value is passed in:
CREATE PROCEDURE MyProc
@MyDate DATETIME = NULL
AS
IF @MyDate IS NULL SET @...
55
votes
6
answers
139k
views
Measuring Query Performance : "Execution Plan Query Cost" vs "Time Taken"
I'm trying to determine the relative performance of two different queries and have two ways of measuring this available to me:
1. Run both and time each query
2. Run both and get "Query Cost" from the ...
11
votes
2
answers
7k
views
Redundant data in update statements
Hibernate generates UPDATE statements, which include all columns, regardless of whether I'm changing the value in that columns, eg:
tx.begin();
Item i = em.find(Item.class, 12345);
i.setA("a-value");
...
93
votes
11
answers
65k
views
How do you interpret a query's explain plan?
When attempting to understand how a SQL statement is executing, it is sometimes recommended to look at the explain plan. What is the process one should go through in interpreting (making sense) of an ...
52
votes
7
answers
25k
views
Meaning of "Select tables optimized away" in MySQL Explain plan
What is the meaning of Select tables optimized away in MySQL Explain plan?
explain select count(comment_count) from wp_posts;
+----+-------------+---------------------------+---------------------...
4
votes
2
answers
645
views
Shredding XML From Execution Plans
I'll preface this by saying that I hate XML, horrible stuff to work with, but necessary sometimes.
My current issue is that I'm trying to take the XML from an execution plan (supplied by a user, so ...
97
votes
6
answers
104k
views
SQL Server Plans : difference between Index Scan / Index Seek
In a SQL Server Execution plan what is the difference between an Index Scan and an Index Seek
I'm on SQL Server 2005.
26
votes
9
answers
13k
views
Performance of SQL "EXISTS" usage variants
Is there any difference in the performance of the following three SQL statements?
SELECT * FROM tableA WHERE EXISTS (SELECT * FROM tableB WHERE tableA.x = tableB.y)
SELECT * FROM tableA WHERE EXISTS ...
29
votes
3
answers
27k
views
How can I analyse a Sqlite query execution?
I have a Sqlite database which I want to check the indexes are correct. MS SQL Analyser is great at breaking down the query execution and utilised indexes.
Is there a similar tool for Sqlite?
16
votes
7
answers
13k
views
SQL order of operations [duplicate]
If I run the following SQL query
SELECT *
FROM A
LEFT JOIN B
ON A.foo=B.foo
WHERE A.date = "Yesterday"
Does the WHERE statement get evaluated before or after the JOIN?
If after, what would be a ...
3
votes
1
answer
716
views
SQL Server Views | Inline View Expansion Guidelines
Background
Hello all!
I recently learned that in newer versions of SQL Server, the query optimizer can "expand" a SQL view and utilize inline performance benefits. This could have some ...
62
votes
3
answers
222k
views
How do I view the Explain Plan in Oracle Sql developer?
I have few SQL queries which has very low query running performance and I want to check the query execution plan for this query. I am trying to execute the below query but its not showing any query ...
8
votes
1
answer
2k
views
How to force evaluation of subquery before joining / pushing down to foreign server
Suppose I want to query a big table with a few WHERE filters. I am using Postgres 11 and a foreign table; foreign data wrapper (FDW) is clickhouse_fdw. But I am also interested in a general solution.
...
3
votes
5
answers
2k
views
Sql wildcard: performance overhead?
I've Googled this question and can't seem to find a consistent opinion, or many opinions that are based on solid data. I simply would like to know if using the wildcard in a SQL SELECT statement ...