Details
-
Task
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
Description
You can reduce Handler_read_next in an INNER JOIN by specifying the column to be joined IS NOT NULL in the where clause, which is implicitly true:
-- 15% execution time reduction with large number of matching rows
|
select count(*) from t1 inner join t2 on t1.id=t2.a where t2.b=98765;
|
select count(*) from t1 inner join t2 on t1.id=t2.a where t2.b=98765 and t2.a is not null;
|
-- 80% execution time reduction with smaller number of matching rows
|
select count(*) from t1 inner join t2 on t1.id=t2.a where t2.b=54321;
|
select count(*) from t1 inner join t2 on t1.id=t2.a where t2.b=54321 and t2.a is not null;
|
I kept buffer pool as 128MB since the tables are pretty small on disk and the results are more pronounced when not all data fits in memory.
I wanted to include a way to generate this with sequence tables (which is what I used) but a dump file would be a lot easier and takes about 5 minutes to load on my pretty small instance. Is there a way to send a 300+MB file?