Join optimization# Database - 数据库
a*s
1 楼
I have two tables. table email has 1 million records. table domain has 20
records. domain is part of email address.
for example: email: a*******[email protected]
domain: yahoo.com
create table email(email varchar(40) primary key, domain varchar(20), index(
domain));
create table domain(domain varchar(20) primary key);
case1:
select p.email from email p, domain q where p.domain = q.domain
select p.email from email p, domain q where q.domain = p.domain
Is it the same?
Does the databa
records. domain is part of email address.
for example: email: a*******[email protected]
domain: yahoo.com
create table email(email varchar(40) primary key, domain varchar(20), index(
domain));
create table domain(domain varchar(20) primary key);
case1:
select p.email from email p, domain q where p.domain = q.domain
select p.email from email p, domain q where q.domain = p.domain
Is it the same?
Does the databa