Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-36483

Optimizer Trace Replay step #1: dump DDLs of tables/views

    XMLWordPrintable

Details

    • Q2/2025 Development

    Description

      This is a part of MDEV-27189.

      Step 1 is to dump the DDLs of all tables and VIEWs used in the query.

      Use some setting (e.g. add a variable optimizer_trace_store_ddls) to enable this.

      When enabled, all tables/VIEWs used by the query should be dumped into trace.
      Then, one can use JSON_QUERY to extract the definitions.
      Then, it should be possible to feed these definitions into the client. This will create
      appropriate tables/views. After that, one should be able to run the original query.

      Things to note:

      • Query may use tables from different databases. This is ok. Make sure DDLs do not rely on the database's character set.
      • Tables may be re-created in any order (EDIT: what about foreign keys? Are they printed? If yes, there are restrictions in which order one can run CREATE TABLE statements), VIEWs must be re-created in the "dependency" order: if view1 uses view2, view2 must be created first.
      • What about Stored Functions? Dump them too or produce an error?

      Attachments

        Issue Links

          Activity

            People

              bsrikanth Srikanth Bondalapati
              psergei Sergei Petrunia
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.