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
-1
votes
1 answer

Unable to add index which speeds up SQL query

I have a SQL query, which I know is inefficient, based on mysql.slow_query log. I am using MySQL8. I have three different tables, see show create table at bottom. Basically, a catch belongs to exactly one beat, a beat can have many catches. A catch…
larsesen
  • 63
  • 2
  • 8
-1
votes
1 answer

Optimal explain plan

In theory, which of these would return results faster? I'm having to deal with almost half a billion rows in table and coming up with a plan to remove quite a few. I need to ensure I'm providing the quickest possible…
user3299633
  • 2,971
  • 3
  • 24
  • 38
-1
votes
2 answers

Use Indexes to optimise my query OR Mysql

I have read through a lot of documentation on how to use EXPLAIN and indexes on sitepoint and mysql documentation website. Even found a few PDFs. But my query seems a bit complex than all the example I have come across. I have been trying to…
Peter
  • 60
  • 8
-1
votes
1 answer

Func in dictionary, how does this code work? C#

I am quite new in C# and my professor gave me this code, can you explain how does it work? I am curious about all these "=>" operators, and what is going on in Dictionary. _operationFunction = new Dictionary> …
Dairon
  • 13
  • 1
-1
votes
1 answer

Why does an index scan retrieve two rows when there should only be one?

In tinkering with pgbench and EXPLAIN, I found the following: [root@fc26c91163dc /]# pgbench -i 100000 of 100000 tuples (100%) done (elapsed 0.21 s, remaining 0.00 s) vacuuming... creating primary keys... done. [root@fc26c91163dc /]# psql psql…
richyen
  • 8,114
  • 4
  • 13
  • 28
-1
votes
1 answer

Explore Spark Execution Plan, number of Stages, etc

I need to optimize my pyspark code in order to have an execution plan as parallel as possible; I would know if there is a better way than the .explain method (that is unreadable) to explore the DAG, like a "normal" graph object. For example it would…
DPColombotto
  • 159
  • 1
  • 3
  • 11
-1
votes
1 answer

does mysql 5.7 always perform a type index of explain when a index column and whatever the 'like pattern' is?

an interview question :"when does mysql index not take in useage ?" someone say:" when use '%' in like and '%' is the first char." then I test the sql, and get puzzled... does he means 1.in some like case mysql do not use index for searching or…
-1
votes
1 answer

Successful use of index in mysql fuzzy query? Shouldn't the key attribute be null?

I created a table test_demo,and added 5000+ datas SET FOREIGN_KEY_CHECKS=0; DROP TABLE IF EXISTS `tb_test`; CREATE TABLE `tb_online_disk_mgmt` ( `id` int(11) NOT NULL AUTO_INCREMENT, `node_name` varchar(512) NOT NULL COMMENT '节点名称', …
Amos Sun
  • 11
  • 3
-1
votes
1 answer

I'm getting an exception when parsing JSON

I'm making a program for saving passwords (only for me) with open(file, mode='w', encoding='Latin-1') as FA: try: FAJ = json.load(FA) except Exception: tafa = {tarr[0]: {'login': tarr[1], 'password': tarr[2]}} …
crousap
  • 49
  • 1
  • 1
  • 5
-1
votes
2 answers

what is meaning of "Select tables optimized away" in mysql5.7 excution plan?

i explain a query in mysql5.7.16, i can't understand what is meaning of "Select tables optimized away" in the plan. i am searching for a long time on google, but no use. who can give me ideas ?thanks! the scenario is…
elison
  • 1
-1
votes
1 answer

Slow MySQL query, EXPLAIN shows Using temporary; Using filesort

This query: EXPLAIN SELECT ppi_loan.customerID, loan_number, CONCAT(forename, ' ', surname) AS agent, name, broker, (SELECT timestamp FROM ppi_sar_status …
swdee
  • 33
  • 7
-1
votes
1 answer

How optimize this query

select mobile_no,mobile_source_type_id,voter_id,district_id, constituency_id,tehsil_id,local_election_body_id,panchayat_id, booth_id,is_dnd from mobile_numbers2 where mobile_no not in ( SELECT mobile_number …
Mohan
  • 1
-1
votes
2 answers

Can somebody explain these lines in this code?

In this source-code of Arwin I saw : fprc_func = GetProcAddress(hmod_libname,argv[2]); if(fprc_func == NULL) { printf("Error: could find the function in the library!\n"); exit(-1); } printf("%s is located at 0x%08x in…
piratos
  • 29
  • 2
-1
votes
2 answers

How make use of EXPLAIN keyword? I got the following result

I did add explain keyword in front of my query but had no idea how to use it for query optimization. Output looks like : https://drive.google.com/file/d/0B070X_hyTgDbR195REY3Q0E3MVU/view?usp=sharing
Binaya Shrestha
  • 440
  • 3
  • 12
-1
votes
2 answers

EXPLAIN in postgresql not working

I have the following SQL code but it's not working, it says syntax error: EXPLAIN DROP TABLE cool_table Does anyone know why? I wrote this question because I was taught to always use EXPLAIN before running a query on the database to avoid running a…
Kevin Zhao
  • 2,113
  • 2
  • 14
  • 18
1 2 3
39
40