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
-1
votes
2 answers

More Efficient Union Statement Than This?

I'm trying to wire up some generic search results, and would like it to perform as well as I could possibly make it happen. It's not terrible right now, but I feel like I could potentially improve upon the "where" part of this, or even condense…
-1
votes
1 answer

SQL Server 2008 - Bit Param Evaluation alters Execution Plan

I have been working on migrating some of our data from Microsoft SQL Server 2000 to 2008. Among the usual hiccups and whatnot, I’ve run across something strange. Linked below is a SQL query that returns very quickly under 2000, but takes 20 minutes…
Nathanial Woolls
  • 5,231
  • 24
  • 32
-1
votes
3 answers

How to optimise slow SQL query

I need a help to optimise this query. In stored procedure this part is executed for 1 hour (all procedure need 2 to execute). Procedure works for a large amount of data. Query works with two temporary tables. Both use indexes: create unique…
-1
votes
1 answer

Query Stuck in Suspended mode with IO_Completition as Wait Type

I am running a query in SQL Server 2008r2, it is stuck with Task State: Suspended (Sometimes changes to Running but mostly Suspended) Wait Type: IO_Completion. There is another query running on the tempdb at the same time. Is there any way to solve…
daniely
  • 7,313
  • 5
  • 29
  • 46
-1
votes
1 answer

Oracle optimizer for executing a query

PLAN_TABLE_OUTPUT -------------------------------------------------------------------------------- Plan hash value: 2822030489 --------------------------------------------------------------------------------------------- | Id | Operation …
Jim
  • 482
  • 1
  • 5
  • 20
-1
votes
1 answer

DB2 Plan table method

Which of the method value given in a plan table row is better when a join is involved in tables? method=1, nested loop join method=2, merge scan join method=4, hybrid join
-1
votes
1 answer

Convert the MySQL explain plan to string

I need to convert this +----+-------------+---------+------+---------------+------+---------+------+------+-------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra…
EPadronU
  • 49
  • 1
  • 3
-1
votes
1 answer

Different values for cache plan size in plan cache and in execution plan

Just found that for a query running in sql server 2012 .. the cache plan size in actual execution plan gives the size as 16KB where as the plan cache the value is 24KB(24576 bytes).. any idea y is it so?
Ahmad Osama
  • 91
  • 1
  • 11
-2
votes
0 answers

Restructure SQL to enable query-planer to use result from subquery efficiently

I have a query: select * from tableA where colA > (select max(colA) from tableB) This is terribly slow compared to: select * from tableA where colA > 10 There are indices on tableA and tableB on colA. If it matters, this problem occurs in…
Vertago
  • 315
  • 2
  • 16
-2
votes
1 answer

Left join on primary key without selecting fields and Oracle execution plan

I need an explanation and an advice on the execution plan in Oracle. I have 3 tables in my Oracle database: t (id, name, t1_id, t2_id) t1 (id, name) t2 (id, name) id is a primary key in each table. Table t has 13 000 000 rows, t1 has 4 000 000…
Room'on
  • 101
  • 1
  • 7
-2
votes
1 answer

Performance / Explain plan for delete statements

How to check the Performance plan for delete statements since the Explain Plan is not showing the cost /Cardinality (showing only for select statements) Or is there any other way to check the performance for delete statements in Oracle? Delete using…
-2
votes
2 answers

Improve slow query when the number of the records doubles

I have a query that select data from a table. This table records number vary based on users input. When the number of records is around 60,000 or less it is pretty fast ( less than 2 minutes). But when I double number of records around 120,000 it…
asmgx
  • 7,328
  • 15
  • 82
  • 143
-2
votes
1 answer

improving a select * from statement on sql

How a to increase the perfomance of a SQL Statement (select * from table where param1=123,param2=345 ) .Suppose a table having more than 500,000 rows of data. Its a DBF to SQL migration application. All data are migrated to SQL now . while…
-2
votes
1 answer

Optimization SQL

I'm pretty new to SQL writing and trying to learn how to optimize my query. I saw the suggestion online are: explain plan and indexing.(I'm using Teradata) I have some questions: Teradata has "Optimizer" after parsing engine, does it mean that the…
ADJ
  • 102
  • 3
  • 9
-2
votes
3 answers

How to optimize this query with a self-join?

I have the following table: CREATE TABLE lab_data ( id int(11) NOT NULL, patient_sid int(11) DEFAULT NULL, double_value double DEFAULT NULL, string_value varchar(7) DEFAULT NULL, data_type_id int(11) DEFAULT NULL, event_date datetime…
horcle_buzz
  • 2,101
  • 3
  • 30
  • 59
1 2 3
95
96