Skip to content

Instantly share code, notes, and snippets.

@spetrunia
Created June 21, 2021 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spetrunia/72137799bdc298b332dd3cfe4de999e6 to your computer and use it in GitHub Desktop.
Save spetrunia/72137799bdc298b332dd3cfe4de999e6 to your computer and use it in GitHub Desktop.
create table t1 (
key1 int,
col1 int
);
insert into t1 select a, a from one_m;
create index t1_key1 on t1(key1);
create table t2 (
key1 int,
col1 int
);
insert into t2 select a, a from one_m;
create index t2_key1 on t2(key1);
analyze;
explain SELECT * FROM
t1 LEFT JOIN t2 on (t1.key1<100 AND t2.key1=t1.col);
explain
select *
from t1 inner join t2 on (t1.key1<100 and t2.key1=t1.col);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment