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

There is no possible_keys available, but there exists keys in the where clause

CREATE TABLE `words_data` ( `id` int(11) NOT NULL auto_increment, `words` varchar(50) default '', `pid` int(8) default '0', `baiyephp` int(11) default '0', PRIMARY KEY (`id`), KEY `baiyephp` (`baiyephp`), KEY `words` (`words`), KEY…
yuhai
  • 91
  • 5
-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

Judging Length of SQL Query based on Explain

I am trying to get a ball park estimate about how long a query is going to take based on the output of the explain. I am using a MYSQL database. I know that you can't determine how a long a query is going to take with any certainty. I am just…
Spencer
  • 21,348
  • 34
  • 85
  • 121
-2
votes
1 answer

Apple Division CSES Qustion SOlution

so this is the link of the question https://cses.fi/problemset/task/1623. What does this code snippet mean?? :- for (int i = 0; i < 1 << n; ++i) { ll cs = 0; for (int j = 0; j < n; ++j) if (i >> j & 1) cs += p[j]; if…
Saumya Nayak
  • 21
  • 1
  • 7
-2
votes
2 answers

SQL Query simplification (EXPLAIN COST 58)

Can someone help in simplifying below query. Cost of it shows as 58. b.dueDate and b.tID are composite key. a.tID is primary key and foreign key between table 1 and 2. SELECT test.tID, test.sor_acct_id, test.pmt, test.status FROM ct.tab1 a, …
-2
votes
1 answer

Explain this bit of code to a beginner

for x in xrange(12): if x % 2 == 1: continue print x i know what it does, but the language doesn't make sense to me. In particular the second line is where i am lost.
Zack
  • 3
  • 2
-2
votes
1 answer

Can someone please explain the following code in javascript; it is used to read a text file, but I don't know about the XML and AJAX stuff?

I'm trying to read a text file, and the code that I have completely works. The problem is that I don't understand the code, especially all the onreadystatechange and new XMLHttpRequest(); and the status stuff- I am very very confused!!!! //load…
Stephen Gevanni
  • 43
  • 1
  • 11
-2
votes
1 answer

MatLab ode45 explanation

For a project I need to understand a matlab code, but as I am quite new I dont really understand what is happening. I have a function file and a script file. Function: function dxdt = sniffer_ode(t,x,par,tu) X = x(1); R = x(2); k1 = par(1); k2…
Joel
  • 3
  • 2
-3
votes
1 answer

Why this simple query not using any one index?

Query: SELECT *, history_count as `count` FROM pdf_history WHERE 1 AND history_date>=1426180929 AND history_count!=0 EXPLAIN id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE …
-4
votes
1 answer

A question about the feasibility of a script

Imagine you have a table of employee data that includes each employee's name, job title, and the name of their supervisor. You want to find the total number of employees in each job category. WITH RECURSIVE job_categories AS ( SELECT job_title,…
-4
votes
1 answer

getting errors in a java class

I'm very new to this java language and practicing to build my basics. So here is the code and also the error please tell me how to resolve this class Solution { public int[] twoSum(int[] nums, int target) { for(int i = 0; i <…
Saumya
  • 3
  • 1
-4
votes
1 answer

Java unsynchronized threads, how could this answer appear and how to explain it

Which two are possible results? (Select two) public class Cruiser { private int a = 0; public void foo() { Runnable r = new LittleCruiser(); new Thread(r).start(); new Thread(r).start(); } public static…
-4
votes
1 answer

Javascript : ask an explanation

here's the full code: function LongestWord(sen) { // we use the regex match function which searches the string for the // pattern and returns an array of strings it finds // in our case the pattern we define below returns words with //…
Dell Watson
  • 367
  • 1
  • 3
  • 13
-4
votes
1 answer

How can I optimize view in MySQL?

Load take 60 sec, how can I optimize? Explain struct: explain tablename; IMG : https://i.stack.imgur.com/TfbY3.png Explain SQL explain select * from tablename; IMG : https://i.stack.imgur.com/jHI47.png REAL DB DROP TABLE IF EXISTS…
1 2 3
39
40