dbDBKraftDocs
Documentation/DBA modules
Chapter 29

Index Advisor

Tests candidate indexes and tells you whether the optimizer would actually use them — without permanently building anything.

#29.1Loading the SQL to analyse

Two ways:

By object name. Type a name into the box (accepts NAME or SCHEMA.NAME). DBKraft resolves the real owner and type first — so it reports the truth rather than guessing — and then:

Object typeWhat is loaded
ViewThe view’s underlying SELECT, extracted from its DDL.
Table or Materialized ViewA starter query is generated for you: a projection of the first columns and a WHERE clause on a selective-looking column, with <value> as a placeholder. A note explains that a table has no query of its own — you must set the predicate to describe the access pattern you want indexed.
Anything elseThe full source, with a note asking you to trim it to the single SELECT you want analysed.

The ⟳ button reloads; the × clears everything.

By pasting. Paste any query into the text area.

#29.2Estimate mode vs Measure mode

ModeHow it worksCost
Estimate (default)Creates a hypothetical NOSEGMENT index that the optimizer costs but never stores, then drops it.Fast and light. No storage, no writes.
MeasureCreates a real INVISIBLE index, times the query with the index visible and invisible in this session only, then drops it.Slower and needs CREATE INDEX privilege, but gives real timings.

The panel explains the active mode in a line beneath the editor.

#29.3Reading recommendations

Press Analyze. Each candidate shows:

  • The table it is on.
  • A pill: n % faster (green) when the optimizer would use it and it helps, or no gain when it would not.
  • The metric — cost X → Y in estimate mode, Xms → Yms in measure mode.
  • The columns the index covers.
  • The CREATE INDEX statement, with a copy button.

When there are no recommendations, the panel says "The optimizer is already using good access paths." — a useful answer in itself.

#29.4Explain with AI

Explain with AI sends the query and every candidate (with its metric and whether the optimizer would use it) to your AI provider, and returns plain-language advice on which indexes are worth creating and which are not, including trade-offs — write overhead, storage, redundancy with existing indexes.