explain

Using IN with a subquery doesn't use index

痞子三分冷 提交于 2021-02-07 10:51:49
问题 I have the fowlloing query select * from mapping_channel_fqdn_virtual_host where id in (1, 2, 3, 4, 5, 6, 7, 8, 9, 10); explaining the above query gives me the following result: explain select * from mapping_channel_fqdn_virtual_host where id in (1, 2, 3, 4, 5, 6, 7, 8, 9, 10); +----+-------------+-----------------------------------+------------+-------+---------------+---------+---------+------+------+----------+-------------+ | id | select_type | table | partitions | type | possible_keys |

What does eq_ref and ref types mean in MySQL explain

六月ゝ 毕业季﹏ 提交于 2021-01-20 15:31:15
问题 When we prefix an SQL query with the keyword "explain" we get a table with some columns. Please tell me what is the "type" column. What does eq_ref and ref mean in that context. 回答1: I'll try an explanation... eq_ref – imagine that you have two tables. Table A with columns (id, text) where id is a primary key. Table B with the same columns (id, text) where id is a primary key. Table A has the following data: 1, Hello 2, How are Table B has the following data: 1, world! 2, you? Imagine eq_ref

What does eq_ref and ref types mean in MySQL explain

爱⌒轻易说出口 提交于 2021-01-20 15:27:42
问题 When we prefix an SQL query with the keyword "explain" we get a table with some columns. Please tell me what is the "type" column. What does eq_ref and ref mean in that context. 回答1: I'll try an explanation... eq_ref – imagine that you have two tables. Table A with columns (id, text) where id is a primary key. Table B with the same columns (id, text) where id is a primary key. Table A has the following data: 1, Hello 2, How are Table B has the following data: 1, world! 2, you? Imagine eq_ref

How to force mysql UPDATE query to use index? How to enable mysql engine to automatically use the index instead of forcing it?

ぃ、小莉子 提交于 2020-12-08 08:01:52
问题 Below is the update query/query plan that is not using the compound index that was created recently. The explain shows that its not using the compound index named radacctupdate which i think will make the update query faster. There are other indexes on table too which are used by other queries. EXPLAIN UPDATE radacct SET acctstoptime = '2017-01-08 11:52:24', acctsessiontime = unix_timestamp('2017-01-08 11:52:24') - unix_timestamp(acctstarttime), acctterminatecause = '', acctstopdelay =

How to force mysql UPDATE query to use index? How to enable mysql engine to automatically use the index instead of forcing it?

蓝咒 提交于 2020-12-08 07:58:59
问题 Below is the update query/query plan that is not using the compound index that was created recently. The explain shows that its not using the compound index named radacctupdate which i think will make the update query faster. There are other indexes on table too which are used by other queries. EXPLAIN UPDATE radacct SET acctstoptime = '2017-01-08 11:52:24', acctsessiontime = unix_timestamp('2017-01-08 11:52:24') - unix_timestamp(acctstarttime), acctterminatecause = '', acctstopdelay =

Speeding up PostgreSQL queries (Check if entry exists in another table)

不羁的心 提交于 2020-06-27 05:15:34
问题 I need some help to improve the speed of a query. I have 3 tables: 1- pairTable2 a 4 columns table: - genomic_accession: grouping column (don't care for this question) - assembly: grouping column (don't care for this question) - product_accession: column used to search in other table - tmpcol: column used to search in other table 2- SBPDB an 1 column table: - product_accession: column used to search in other table 3- cacheDB an 1 column table: - product_accession: column used to search in

Hive explain plan understanding

丶灬走出姿态 提交于 2020-06-21 10:31:13
问题 Is there any proper resource from where we can understand explain plan generated by hive completely? I have tried searching it in the wiki but could not find a complete guide to understand it. Here is the wiki which briefly explains how explain plan works. But I need further information on how to infer the explain plan. https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Explain 回答1: I will try to explain a litte what I know. The execution plan is a description of the tasks

Hive explain plan understanding

时间秒杀一切 提交于 2020-06-21 10:30:09
问题 Is there any proper resource from where we can understand explain plan generated by hive completely? I have tried searching it in the wiki but could not find a complete guide to understand it. Here is the wiki which briefly explains how explain plan works. But I need further information on how to infer the explain plan. https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Explain 回答1: I will try to explain a litte what I know. The execution plan is a description of the tasks

Hive explain plan understanding

人走茶凉 提交于 2020-06-21 10:30:00
问题 Is there any proper resource from where we can understand explain plan generated by hive completely? I have tried searching it in the wiki but could not find a complete guide to understand it. Here is the wiki which briefly explains how explain plan works. But I need further information on how to infer the explain plan. https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Explain 回答1: I will try to explain a litte what I know. The execution plan is a description of the tasks

Why does MySQL not always use index for select query?

旧城冷巷雨未停 提交于 2020-06-01 06:23:00
问题 I have two tables in my database users and articles. Records in my users and articles table are given below: +----+--------+ | id | name | +----+--------+ | 1 | user1 | | 2 | user2 | | 3 | user3 | +----+--------+ +----+---------+----------+ | id | user_id | article | +----+---------+----------+ | 1 | 1 | article1 | | 2 | 1 | article2 | | 3 | 1 | article3 | | 4 | 2 | article4 | | 5 | 2 | article5 | | 6 | 3 | article6 | +----+---------+----------+ Given below the queries and the respected