[MDEV-383] Evaluate subquery predicates earlier or later depending on their SELECTIVITY Created: 2012-07-05  Updated: 2020-10-16

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

Type: Task Priority: Major
Reporter: Sergei Petrunia Assignee: Igor Babaev
Resolution: Unresolved Votes: 3
Labels: gsoc13, gsoc19, gsoc20

Issue Links:
Relates
relates to MDEV-83 Cost-based choice for the pushdown of... Stalled

 Description   

(Based on conversation with Igor)
There are a lot of subquery conditions out there that are inexpensive to
evaluate and have good selectivity.

If we just implement MDEV-83, we may get regressions. We need to take
subquery condition's selectivity into account.

It is difficult to get a meaningful estimate for an arbitrary, correlated
subquery predicate.

One possible solution is to measure selectivity during execution and reattach
predicates on the fly.

We don't want to change the query plan all the time, one way to dynamically
move items between item trees is to wrap them inside Item_func_trig_cond so
we can switch them on and off.



 Comments   
Comment by Tavneet Singh [ 2020-03-22 ]

Hi, as part of GSOC I would like to take up this project. It seems quite challenging to estimate the threshold where we change the query plan. I have built the environment locally and have started going through the code base. Among the beginner friendly issues, should I start with MDEV-21921 or MDEV-21778 to get acquainted with the code base or is there a more relevant task I could pick up ?

Comment by Igor Babaev [ 2020-03-23 ]

Hi Tavneet,

For the beginning you could introduce an option that would allow not to
push correlated subquery predicates to joined tables.

Please send your questions to maria-developers@lists.launchpad.net
it's a public mailing list dedicated to MySQL and MariaDB internals, source
code, and related things. I am subscribed, so I'll see you mail there,
and you
may be sure I will, because it won't be accidentally caught by my spam
filter,
or sorted out in some obscure folder. Furthermore other subscribers will see
your question and can reply if I'm not available.

Regards,

Igor.

Generated at Thu Feb 08 06:28:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.