Skip to content

Latest commit

 

History

History
34 lines (21 loc) · 1.82 KB

query-manager.md

File metadata and controls

34 lines (21 loc) · 1.82 KB

Query Manager

New abstraction

QueryManager is the high level interface of the core engine, Parser parse raw query as the Plan and sumitted to QueryManager.

  1. AstBuilder analyze raw query string and create Statement.
  2. QueryPlanFactory create Plan for different Statement.
  3. QueryManager execute Plan.

Screen Shot 2022-10-25 at 5 05 46 PM

Core engine define the interface of QueryManager. Each execution engine should provide the implementation of QueryManager which bind to execution enviroment. QueryManager manage all the submitted plans and define the following interface

  • submit: submit queryexecution.
  • cancel: cancel query execution.
  • get: get query execution info of specific query.

image

Parser parse raw query as Statement and create AbstractPlan. Each AbstractPlan decide how to execute the query in QueryManager.

image (1)

QueryService is the low level interface of core engine, each Plan decide how to execute the query and use QueryService to analyze, plan, optimize and execute the query.

Screen Shot 2022-10-25 at 5 07 29 PM

Change of existing logic

  1. Remove the schedule logic in NIO thread. After the change, a. Parser will be executed in NIO thread. b. QueryManager decide query execution strategy. e.g. OpenSearchQueryManager schedule the QueryExecution running in sql-worker thread pool.