[MDEV-27189] Optimizer Trace: save all info needed for replay Created: 2021-12-07  Updated: 2023-12-22

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

Type: Task Priority: Major
Reporter: Sergei Petrunia Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: optimizer

Issue Links:
Relates

 Description   

Optimizer trace contains a lot of info describing the query:

  • Original query text
  • Definitions of all used VIEWs
  • All kinds of estimates that the optimizer used:
    • records_in_range estimates
    • index statistics used by
    • selectivity estimates
    • table read costs
  • Indexes considered by the optimizer

This makes it possible to debug an optimizer problem: re-run the optimizer and manually re-create the environment by "faking" the record counts and the estimates.

There are two problems

  • 1. Optimizer trace is not fully self-contained.
  • 2. Re-creating the environment is labor-intensive (I wrote dirty patches that put the fake statistics in place)

This task is about solving #1, and possibly #2.

For #1, we need:

  • Column definitions (their datatypes. Basically, SQL definitions).
  • TODO: anything else?

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