Questions tagged [explain]

Explain is a SQL command that shows the execution plan of a query.

Explain is an useful command used in various Database servers(like Oracle, MySQL, PostgreSQL, etc). It shows the execution plan of a query.

Oracle:

EXPLAIN PLAN FOR SELECT …

PostgreSQL, MySQL:

EXPLAIN SELECT …

MSSQL doesn't support explain, but uses

"SET SHOWPLAN_TEXT ON".

instead.

599 questions
2
votes
1 answer

Hive View query is not using partition

I have hive tables and views on top of that tables . When executing query on Table using where clause for partition columns , I see from explain plain that query is using partition column . But same query when running on view , it is showing from…
Dibakar Paul
  • 25
  • 1
  • 8
2
votes
2 answers

sql plan discrepancy in DBMS_XPLAN.DISPLAY_CURSOR

Running on Oracle 12.1 I am looking for SQL with full table scans in their plans. When I look in: select * from V$SQL_PLAN where sql_id = '89p47f9wnnwg9' I get 21 rows back, one of them with TABLE ACCESS FULL However, if I call this for the same…
OldProgrammer
  • 12,050
  • 4
  • 24
  • 45
2
votes
1 answer

Are query execution plans stored anywhere in postgresql?

I am trying to figure out if PostgreSQL query execution plans are stored somewhere (possibly as complimentary to pg_stat_statements and pg_prepared_statements) in a way they are available for longer than the duration of the session. I understand…
chi
  • 471
  • 3
  • 18
2
votes
3 answers

MySQL Index and Explain Plan

I have this query: SELECT * FROM dwDimDate d LEFT JOIN tickets t FORCE INDEX FOR JOIN (idx_tickets_id_and_date) ON DATE_FORMAT(t.ticket_date, '%Y%m%d') = d.date_key LEFT JOIN sales s ON s.ticket_id = t.ticket_id WHERE d.date_key BETWEEN 20130101…
hyphen
  • 2,368
  • 5
  • 28
  • 59
2
votes
0 answers

How to find the time for each step of the process in Spark

I use the following function written in PySpark to log steps in a SQL table. def log_df_update(spark,IsComplete,Status,EndDate,ErrorMessage,RowCounts,StartDate,FilePath,tablename): import pandas as pd l =…
Raj
  • 1,049
  • 3
  • 16
  • 30
2
votes
1 answer

Making radix sort in-place - trying to understand how

I'm going through all the known / typical sorting algorithms (insertion, bubble, selection, quick, merge sort..) and now I just read about radix sort. I think I have understood its concept but I still wonder how it could be done in-place? Let me…
eyesima
  • 215
  • 4
  • 15
2
votes
2 answers

Mongo - How to explain query without executing it

I'm new to Mongo and have searched but don't see a specific answer. I understand that Mongo explain method will execute the query in parallel with possible access plans and choose a winning plan based on execution time. The Best Practices Guide…
2
votes
0 answers

Explaining the Explain in teradata

Explain sel * from sandbox.comapny_employees ce left join sandbox.comapny_age ca on ce.age=ca.age and ce.age>42 some times its really confusing to understand how explain plan was created. below explain plan totally skipped the…
dev
  • 732
  • 2
  • 8
  • 29
2
votes
1 answer

MySQL Performance Degrades during Concurrent Stored Proc Execution

Machine Specs : macOS Sierra, Version 10.12.5, Memory 8 GB MySQL Version: MySQL Enterprise Server - Advanced Edition (Commercial)3 innodb_version : 5.7.18 Problem : When same stored procedure is called concurrently by different sessions, the…
DeeJay14
  • 99
  • 7
2
votes
1 answer

Why is UIView removed from heirarchy after presenting view controller?

Ok I just ran into something bizarre. I've got my app controller dependency injecting a view (header) into a view controller. That view controller presents another view controller modally and dependency injects it's own header for the presenting…
Aquila Sagitta
  • 438
  • 3
  • 9
2
votes
0 answers

explains shows fast execution time, but running the query never returns

I have a query that seems to never return. When I run explain on that query, it shows me executionStats.executionTimeMillis of 27ms, and that the initial input-stage is IXSCAN that should return 4 objects only. I've confirmed that querying for the…
marmor
  • 27,641
  • 11
  • 107
  • 150
2
votes
1 answer

Explain this Kotlin function structure

I am working with this Kotlin function. I know that we have a function called mPasswordView!!.setOnEditorActionListener, that take parameter TextView.OnEditorActionListener, but what's that after it? we have curly brackets inside parameter?…
Vlad Skurtolov
  • 1,024
  • 1
  • 7
  • 20
2
votes
1 answer

how to understand postgres EXPLAIN output

EXPLAIN SELECT a.name, m.name FROM Casting c JOIN Movie m ON c.m_id = m.m_id JOIN Actor a ON a.a_id = c.a_id AND c.a_id < 50; Output QUERY PLAN …
tarun14110
  • 940
  • 5
  • 26
  • 57
2
votes
1 answer

mysql difference in number of rows scanned

I have a query : mysql> explain SELECT * FROM OTHERS_TINY_URL_TBL WHERE LINK_TYPE = 'BITLY' AND URL_SHORTNER_ID = '5434e3b9e4b03aa06f25da11' AND MODIFIED_TM >= '2016-03-13 21:09:43' AND MODIFIED_TM <= '2017-03-13…
sudeepdino008
  • 3,194
  • 5
  • 39
  • 73
2
votes
2 answers

Clarification of join order for creation of temporary tables

I have a large query in mysql that involves joining multiple tables together. It's too slow, so I've done "explain" and see that it's creating a temporary table, which I suspect of taking most of the execution time. I found some related…
Brick
  • 3,998
  • 8
  • 27
  • 47