mikegoatly / lifti

A lightweight full text indexer for .NET
MIT License
181 stars 9 forks source link

Execution plans #110

Closed mikegoatly closed 7 months ago

mikegoatly commented 7 months ago

Given the work that went into v6 to optimise the query execution paths, having a way to visualize the order that each query part was executed in would help:

  1. Explain how queries are executed, including the weightings that were calculated for each part
  2. Spot any obvious improvements that could be made to the execution order.

Conceptually similar to SQL Server's actual execution plan generation, this would be opt-in when queries are executed against an index:

var results = this.index.Search("\"two three four\"", QueryExecutionOptions.IncludeExecutionPlan);

var executionPlan = results.GetExecutionPlan();

A execution plan would be a hierarchical tree of the query parts, including timing details and scoring breakdowns. For example:

image

You can see that: