[MDEV-26856] Queries with many NOT IN clauses or ORs use a lot of memory Created: 2021-10-19  Updated: 2023-11-30

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

Type: New Feature Priority: Major
Reporter: Sergei Petrunia Assignee: Sergei Petrunia
Resolution: Unresolved Votes: 1
Labels: optimizer, range-optimizer

Issue Links:
Relates
relates to MDEV-21958 Query having many NOT-IN clauses runn... Closed

 Description   

This is a followup to MDEV-21958.

For certain WHERE clauses, range optimizer may consume O(N^2) memory.

The cause of this is that tree_or() allocates its result on MEM_ROOT, while the arguments also remain allocated on MEM_ROOT (See MDEV-21958 for details).

MDEV-21958 itself is marked as closed because I've pushed a limited-scope fix that prevented this behavior for a subset of queries.


Generated at Thu Feb 08 09:48:29 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.