【问题标题】:Meaning of percentage in rows section in explain output of mariadb 10.5mariadb 10.5 解释输出中行部分中百分比的含义
【发布时间】:2020-07-16 21:20:29
【问题描述】:

我最近迁移到 mariadb 10.5,并且遇到了这个特定的输出,其中百分比与解释输出中的行一起显示。我找不到任何相同的文档,可能这是一个新功能。

这到底是什么意思?是关于被读取行的某种概率吗?

MariaDB [c6b2c772b91fd3d8]> explain 
    select 
        `execute_action`, `state_type` 
    from 
        `tabSuperflow Document State` 
    where 
        `parent` = 'Check Point' 
        and `state` = 'Pending TSM Approval - Delivery' 
    order by 
        modified desc \G
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: tabSuperflow Document State
         type: ref|filter
possible_keys: parent,index_on_state
          key: index_on_state|parent
      key_len: 563|563
          ref: const
         rows: 1 (17%)
        Extra: Using index condition; Using where; Using filesort; Using rowid filter
1 row in set (0.001 sec)

【问题讨论】:

  • 表格大概有6行吗?
  • 它有 96 行。

标签: mariadb mariadb-10.5


【解决方案1】:

在一个相当不相关的文档中找到了答案

https://mariadb.com/kb/en/rowid-filtering-optimization/

rows 列显示预期的过滤器选择性,为 5%。

因此,基本上该百分比显示了预期的过滤器选择性,即在此步骤中将使用 where 子句过滤的行。此输出也可以在 filtered 列的解释扩展输出中看到。

MariaDB [c6b2c772b91fd3d8]> explain extended select `execute_action`, `state_type` from `tabSuperflow Document State` where `parent` = 'Check Point' and `state` = 'Pending TSM Approval - Delivery' order by modified desc \G
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: tabSuperflow Document State
         type: ref|filter
possible_keys: parent,index_on_state
          key: index_on_state|parent
      key_len: 563|563
          ref: const
         rows: 1 (17%)
     filtered: 16.67
        Extra: Using index condition; Using where; Using filesort; Using rowid filter
1 row in set, 1 warning (0.001 sec)

【讨论】:

    猜你喜欢
    • 2012-03-08
    • 1970-01-01
    • 2018-02-02
    • 2013-08-25
    • 2011-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-06
    相关资源
    最近更新 更多