{% extends "../../xhrm.html" %} {% block content %}

Index suggestion

{% if indexes %}
    {% for clause, inds in indexes.items() %}
  • Possible indexes for attributes present in {{clause}}:
      {% for index in inds %}
      With access method {{ index.amname }}
      • {% for qual in index.qual %}
      • Attribute
        {{ qual.relname }}.{{ qual.attname}}
        Data distribution
        {% if qual.distinct_values is None %}
        Unknown
        {% else %}
        approximately {{ qual.distinct_values }} distinct values
        {% end %}
      • {% end %}
    • {% end %}
    {% end %}
{% else %} No suitable index to suggest. {% end %}
{% if hypoplan %}
{% if hypoplan.indexes %} The following indexes would be used:
        {% for ind in hypoplan.indexes %}
        {{ind.ddl}}
        {% end %}
        
{% else %} None of the indexes would be used ! {% end %}
{% if hypoplan.indexes %}
{% else %}
{% end %}
EXPLAIN plan without suggested indexes:
{{ hypoplan.baseplan }}
{% if hypoplan.indexes %}
EXPLAIN plan with suggested index
{{ hypoplan.hypoplan }}
Query cost gain factor with hypothetical index: {{
          hypoplan.gain_percent }} %
{% end %}
{% end %}
{% end %}