Please help me explain, multi-table join, I don't understand, thank you SQLcodeselect * from (selectbookid, count (bookid) asdegreefromtb_borrowgroupbybookid) asborrjoin (s Please help explain, multi-table join, thank you!
SQL code
select * from (select bookid,count(bookid) as degree from tb_borrow group by bookid) as borr join (select b.*,c.name as bookcasename,p.pubname,t.typename from tb_bookinfo
, data that does not meet the check conditions and restrictions, and does not read directly, thus greatly reducing the number of records scanned by the storage engine. The extra column displays the using index conditionUsing Temporary: Indicates that interim tables are used to store intermediate results. Temporary tables can be memory temporary tables and disk temporary tables, the execution plan is not visible, you need to see the status variables, used_tmp_table,used_tmp_disk_table to see. Fir
App.jsHere we have loaded the Express, path module, and index under the routes directory via require (). JS and Users.js routing files. To explain the meaning of each line of code.(1) var app = Express (): Generates an express instance app.(2) App.set (' Views ', Path.join (__dirname): Set the Views folder as the folder where the view files are stored, that is, where the template files reside, __dirname are global variables, Stores the folder where t
Using the method, add explain to the SELECT statement before you can:
Such as: Explain SELECT * FROM Test1
Explanation of the Explain column:
Table: Shows which table the data in this row is about
Type: This is an important column that shows what type the connection uses. The connection types from best to worst are const, EQ_REG, ref, range, Indexhe, and all
Poss
zzj@rac1> EXPLAIN Plan for SELECT * from T_user;
explained.
Zzj@rac1> SELECT * from TABLE (Dbms_xplan. DISPLAY);
Plan_table_output
----------------------------------------------------------------------------------------
Plan Hash value:2508602004
----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU) | Time |
---------------------------------------------------------------------
Nanning SEO small knitting to believe that we all will feel for a new station, we choose the core keywords and target keywords, usually is difficult to choose, how we should select the core of our site keywords and target keywords. Let's look at this topic together.
First, the new station positioning core keywords and target key words importance
For the new station, positioning the new station's core keywords and target keyword is a lot of people are difficult to choose things, Nanning seo b
The output of the EXPLAIN Plan command is one of the most important diagnostic tools for resolving SQL inefficiencies. This command loads a work table (the default name is Plan_table), and the table contains the execution plan steps that the Oracle optimizer calculates for the SQL statement. For example:
EXPLAIN Plan for
SELECT empno, ename
From EMP
WHERE ename like ' s% ';
Because the rows in plan_table fo
enterprise most common one kind of phenomenon, is to "the product" itself definition appears the understanding dislocation. For example, some companies define a functional module or application as a product, or even the background of a system as a product. This leads to the lack of compatibility and relevance of all subsequent product-related, systematic work and information due to the narrow or biased definition of the product itself. Imagine such a so-called "product" how can the market compl
Both EXPLAIN plan and AUTOTRACE can view the execution plan. It is worth mentioning that the former is only the optimizer by reading the statistics of the data dictionary to make the ' best ' access path judgment, and does not really go to execute the statement , the latter is actually to execute the SQL statement, while the number of access records, execution plan, statistics and other printing out.
The following results are illustrated and the time
Tags: SQL optimization index INF I/o const PNG SYS temp IMAExplain is MySQL's own query optimizer, which is responsible for the optimizer module of the SELECT statement, which simulates the optimizer's execution of SQL query statements to know how MySQL handles SQL, and the syntax is simple: Explain + SQL Here are a few properties that are queried by explain (Common performance bottlenecks-- Cpu:cpu satura
Tags: def back file Official document int div default Hat InnoDBThis Friday before work, found a strange problem, presumably this background A table with a structure of Create Table:CREATE TABLE' out_table ' (' ID ')int( One) not NULLauto_increment, ' name 'varchar( -) not NULL,
PRIMARY KEY(' id ')) ENGINE=innodbAuto_increment=36865 DEFAULTCHARSET=Latin1 There is a total of 37K rows of data, the data is probably +----+------+
|Id|Name|
+----+------+
| 1 |A|
| 2 |B|
| 3 |C|
| 4 |D|
| 5 |C|
Explain: View execution planUse the Explain keyword to simulate the optimizer executing SQL query statements to know how MySQL handles your SQL statementsAnalyze the performance bottlenecks of your query statements or table structuresWhat information can be obtained using explain:reading order of tablesTypes of operations for data read operationsWhich indexes can be usedWhich indexes are actually usedA refe
For large data volume of query processing, remember to use Explian to see, as far as possible optimization
For example: Explain select surname,first_name form A, a where a.id=b.id
Explain Explanation:
Table: The data that displays this line is about the table.
Type: This is an important column that shows what type of connection is used. The best to worst link type is Const–eq_reg–ref
the index tree and does not require further searching to read the actual rows to retrieve the information in the table. This is easier to understand, that is, whether the index is used 10.6 Using Temporary To resolve the query, MySQL needs to create a temporary table to accommodate the results. A typical case is when a query contains a group by and an ORDER BY clause that can be listed in different cases. The use temporary appears to illustrate that the statement needs to be optimized, for inst
Tags: style blog color os ar using for SP strongToday to do an order task, which need to check for this order number information, because the order number is a list, so want to detect the following statement performance (mainly on limit 1)" Order number in (Order number list) " LIMIT 1Then we review the usage of the following explain:Explain shows how MySQL uses indexes to process SELECT statements and join tables. Can help select better indexes and write more optimized query statements.Using th
* from PC_SPU where cate_id=2; SELECT * from PC_SPU where cate_id=2 and brand_id=2; Optimize ORDER BYSELECT * from PC_SPU WHERE cate_id=2 ORDER by brand_id asc,cate_id DESC; EXPLAIN SELECT * from PC_SPU Force INDEX (idx_example) WHERE cate_id=2 ORDER by brand_id asc,cate_id DESC; This query must be used for this index createindexidx_example ontable1 (Col1ASC, NBSP;COL2NBSP;DESC,NBSP;COL3NBSP;ASC) In this case, the following query can be op
Tags: mysql how where bestExplain shows how MySQL uses indexes to process SELECT statements and join tables. Can help select better indexes and write more optimized query statements.Using the method, add explain to the SELECT statement:Such as:Explain select Surname,first_name form a b where a.id=b.idExplanation of the Explain column:Table: Shows which table the data for this row is aboutType: This is an im
1 useexplainStatement to see the results of the analysis, such asExplain select * from Test1 where id=1;will appear:ID selecttype Table type Possible_keys keykey_len ref rows extra Columnswherein, type=const means that through the index once found, key=primary words, the use of the primary key Type=all, expressed as a full table scan, Key=null is not useful to the index; Type=ref, because this is considered to be multiple matching rows, in a federated query, is generally ref2 Combined index in M
1 useexplainStatement to see the results of the analysis, such asExplain select * from Test1 where id=1;will appear:ID selecttype Table Type possible_keys key Key_len ref rows extra Columnswherein, type=const means that through the index once found, key=primary words, the use of the primary key Type=all, expressed as a full table scan, Key=null is not useful to the index; Type=ref, because this is considered to be multiple matching rows, in a federated query, is generally ref2 Combined index in
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.