Skip to main content

All Questions

Tagged with
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?
Justin's user avatar
  • 86.1k
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 @...
Justin's user avatar
  • 86.1k
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 ...
MatBailie's user avatar
  • 85.8k
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"); ...
Tair's user avatar
  • 3,809
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 ...
user avatar
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; +----+-------------+---------------------------+---------------------...
Chandra Patni's user avatar
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 ...
Rich Benner's user avatar
  • 8,063
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.
cindi's user avatar
  • 4,731
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 ...
Sebastian Dietz's user avatar
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?
Phil Hannent's user avatar
  • 12.2k
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 ...
tinkertime's user avatar
  • 3,022
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 ...
Daniel Miradakis's user avatar
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 ...
Andrew's user avatar
  • 3,730
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. ...
ctlaltdefeat's user avatar
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 ...
Geo Ego's user avatar
  • 1,325

15 30 50 per page
1
2 3 4 5