In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The semi-connection in SQL still has some gaps between MySQL and Oracle, and from the point of view of the test, Oracle's handling is more comprehensive.
First of all, let's take a look at how to test in MySQL. For the test of MySQL, we have also referred to a lot of Haixiang brother's blog articles, and we have also practiced it completely according to his test ideas.
First create the following table:
Create table users (
Userid int (11) unsigned not null
User_name varchar (64) default null
Primary key (userid)
) engine=innodb default charset=UTF8
If you want to insert data, you can use stored procedures. For example, insert 20000 pieces of custom data first.
Delimiter $$
Drop procedure if exists proc_auto_insertdata$$
Create procedure proc_auto_insertdata ()
Begin
Declare
Init_data integer default 1
While init_datasource insert_proc.sql
Query OK, 0 rows affected (0.12 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 1 row affected (5.63 sec)
Then we use the following semi-join query data, which actually executes for about 6 seconds.
Select u.useridreu.userroomname from users u where u.user_name in (select t.user_name from users t where t.useridselect count (u.userid) from users u where u.user_name in (select t.user_name from users t where t.useridexplain extended select count (u.userid) from users u where (u.user_name in (select t.user_name from users t where t.useridset optimizer_switch= "semijoin=off")
Query OK, 0 rows affected (0.00 sec)
Run the original execution time of SQL for nearly 6 seconds again, and the execution time is greatly reduced.
[test] > select count (u.userid) from users u where u.user_name in (select t.user_name from users t where t.useridselect count (u.userid) from users u where (u.user_name in (select t.user_name from users t where t.useridtrue))
Then execute the same statement as in MySQL.
We use trace to look at it, and we only list the case of trace.
SQL > set autot trace exp stat
SQL > select u.userid.u.userroomname from users u where u.user_name in (select t.user_name from users t where t.userid
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.