Questions tagged [sql-execution-plan]

A execution, or query plan, is the breakdown of steps the database engine uses to get a result.

A execution, or query plan, is the breakdown of steps the database engine uses to get a result. Specifically it is the plan that the optimizer determines is the best, most efficient, way to get the data.

The execution plan can be analyzed to determine what is happening and how to improve efficiency. Including finding if an index is being scanned or missing an index altogether. There is also many points of analytic data that can be acquired via the plan including things such as estimated and actual number of rows.

1429 questions
0
votes
0 answers

Query expansion, which term to expand?

Suppose we have a query with the following term: A and B and C and D Now suppose the query is too restrictive, and we want to expand the query, but is there already a way to find which term to expand. Of course, it makes sense to expand the term…
Noor
  • 19,638
  • 38
  • 136
  • 254
0
votes
1 answer

SQL Server 2005: Internal Query Processor Error:

I am trying to execute this following procedure in SQL Server 2005. I was able to execute this in my development server and when i tried to use this in the Live Server I am getting an Error "Internal Query Processor Error: The query processor could…
Geetha
  • 199
  • 1
  • 8
  • 19
0
votes
1 answer

Get list of columns (and tables) in query from XML/JSON explain plan

I have approx. 200 sql statements and I need to analyze what columns and tables are used in those columns. I've found there is XML explain plan available in PostgreSQL 9.0+. Is there a known way how I can get list of used colums and tables from that…
Tomas Greif
  • 21,685
  • 23
  • 106
  • 155
0
votes
1 answer

Is it possible to find out in which table the record is not present using Explain Plan or SQL trace

I have a query with combination of multiple tables. For example: query contains 7 or 8 tables. My query is not fetching any records. Is it possible to find out in which table the record is not present using Explain Plan or SQL Trace in Db2?
arvinth
  • 27
  • 1
  • 8
0
votes
2 answers

Invalid sql statement for "Explain plan for with" statement

I am executing the following query: explain plan for with Foo as ( select * from my_table ) select * from Foo where x = 7; This results in an invalid SQL statement exception in Oracle10g. Without the explain plan the with…
Woot4Moo
  • 23,987
  • 16
  • 94
  • 151
0
votes
1 answer

SQL Explain Plan Intrepretation - Oracle DB

Scenario: I'm getting the same explain plan (Tab Access Full and same numbers for Cost, Bytes and Cardinality) for two different queries on the same table(not indexed / no PK / no FK). Query1: select * from tab1 where col1 = 'A' Query2: select *…
0
votes
1 answer

SQL Server - wrong execution plan?

I have a very big table with a lot of rows and a lot of columns (I know it's bad but let's leave this aside). Specifically, I had two columns - FinishTime, JobId. The first one is the finish time of the row and the second is its id (not unique, but…
duduamar
  • 3,816
  • 7
  • 35
  • 54
0
votes
0 answers

Getting all SQL query plans in SQL Server 2008

I have tried to get the estimated execution plan in SQL Server Management Studio 2008. As far as I know the it always returns the best query plan, as an execution plan. Right now I'm working on a research and I need to get all possible query plans…
0
votes
1 answer

Oracle explain plan letter scheme for rows and/or bytes

I have been unable to find a resource that can clearly define what these values mean. I have a dummy explain plan below that shows all the different letters I have seen for Oracle: Rows | Bytes 21P 10E 11G 15G 5M …
Woot4Moo
  • 23,987
  • 16
  • 94
  • 151
0
votes
2 answers

Where is this SQL statement bottlenecking?

I am trying to write a SQL (Sybase) query to fetch movie theatre information out of a database. When I run the query below, the query just keeps running. Eventually, after 5 minutes or so, I just abort it. There's no bad/illegal SQL, it's just…
user1768830
0
votes
0 answers

Including Actual Query Plan Explodes Execution Time

I'm using SQL Server 2005 and I've got a fairly complex query which is taking a second or two to execute. I wanted to debug performance using the query plan, but when I include the actual execution plan in the output, the query goes from taking 2…
RMD
  • 3,421
  • 7
  • 39
  • 85
0
votes
1 answer

oracle using index even though there is no filter criteeria specified

In this query: SELECT WTTEMPLATE.TEMPLATEuID, MAX (WTTRX.VALUEDATE) AS template_last_use_date FROM wttemplate, wttrx WHERE WTTEMPLATE.TEMPLATEID = WTTRX.TEMPLATEID(+) AND…
Victor
  • 16,609
  • 71
  • 229
  • 409
0
votes
1 answer

Execution Plan Optimization when where clause is removed then added back

I have a stored procedure that uses a table valued function which executes in 9 seconds. If I alter the table valued function and remove the where clause, the stored procedure executes in 3 seconds. If I add the where clause back, the query still…
nmushov
  • 145
  • 1
  • 8
0
votes
1 answer

sql using different execution plans when running a query and when running that query inside a stored procedure?

I have this query, Declare @Prcocessrate float declare @item varchar(20) declare @process varchar(20) declare @branch varchar(20) set @item = 'shirt' set @process = 'kt' set @branch = '1' select @Prcocessrate = ProcessPrice from itemwiseprocessrate…
Razort4x
  • 3,296
  • 10
  • 50
  • 88
0
votes
1 answer

Explain plan issue with group by clause in postgresql 8.4

Below is given detail explanation which is related to explain plan with group by clause problem. table: web_categoryutfv1_24hr_ts_201209 columns: "5mintime",category,hits,bytes,appid rows: 871 Indexes: "web_categoryutfv1_24hr_ts_201209_idx"…