[MDEV-19307] Use functional dependencies when searching for conditions that can be pushed into materialized derived tables Created: 2019-04-23  Updated: 2022-04-25

Status: Open
Project: MariaDB Server
Component/s: Optimizer
Fix Version/s: None

Type: Task Priority: Major
Reporter: Igor Babaev Assignee: Igor Babaev
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
PartOf
is part of MDEV-11588 Support for ONLY_FULL_GROUP_BY functi... Stalled

 Description   

Consider the following query that uses a materialized derived table

select * from 
  (select c, count(d) from t1 where b=f(a) and c=g(b) group by a) as t
where t.b < 2 and t.c > 3

Currently neither b<2 nor c>3 can be pushed into the WHERE clause of derived table t as these conditions does not depend on grouping column a directly or indirectly through equalities.

Using functional dependencies we could state that these conditions actually can be pushed into the WHERE clause of the derived table.

Similarly functional dependencies could be used to push conditions into WHERE clauses of materialized subqueries as well as for pushing conditions from HAVING into WHERE.



 Comments   
Comment by Julien Fritsch [ 2019-08-02 ]

ralf.gebhardt@mariadb.com done

Generated at Thu Feb 08 08:50:39 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.