[MDEV-20444] More information regarding access of a table to be printed inside the optimizer_trace Created: 2019-08-29  Updated: 2019-09-11  Resolved: 2019-09-10

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Fix Version/s: 10.4.8

Type: Task Priority: Major
Reporter: Varun Gupta (Inactive) Assignee: Varun Gupta (Inactive)
Resolution: Fixed Votes: 0
Labels: optimizer_trace

Issue Links:
Relates
relates to MDEV-6111 optimizer trace Closed
relates to MDEV-20443 More information regarding access of ... Closed

 Description   

Example:

                        "table": "lineitem",
                        "best_access_path": {
                          "considered_access_paths": [
                            {
                              "access_type": "ref",
                              "index": "PRIMARY",
                              "rows": 1,
                              "cost": 250.69,
                              "chosen": true
                            },
                            {
                              "access_type": "ref",
                              "index": "i_l_orderkey",
                              "rows": 1,
                              "cost": 498.4,
                              "chosen": false,
                              "cause": "cost"
                            },
                            {
                              "access_type": "ref",
                              "index": "i_l_orderkey_quantity",
                              "rows": 1,
                              "cost": 498.4,
                              "chosen": false,
                              "cause": "cost"
                            },
                            {
                              "type": "scan",
                              "chosen": false,
                              "cause": "cost"
                            }
                          ]

So here we see all the ref accesses and table_scan considered on table lineitem, just add the best access picked to the optimizer trace to make it clear



 Comments   
Comment by Varun Gupta (Inactive) [ 2019-08-29 ]

Also there has been request to add

  • selectivity of conditions when joining a table(computed by function table_cond_selectivity()) [already done in MDEV-20440]
  • best join order picked
  • count of records in the prefix of a partial join(this is already there we already have record count and the selectivity, so this would just record_count*selectivity)
  • total join cardinality
Comment by Sergei Petrunia [ 2019-08-30 ]

Some of that information is alreadyt printed, see https://github.com/MariaDB/server/commit/2dbe472ed011a951b28434ae8e67945e964d2030

Comment by Varun Gupta (Inactive) [ 2019-09-04 ]

Patch
http://lists.askmonty.org/pipermail/commits/2019-September/013963.html

Comment by Sergei Petrunia [ 2019-09-04 ]

Ok to push

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