Cost-Based Optimization

The execution engine, after applying the static optimizations described in the previous section, selects the best execution plan based on the estimated cost of executing them.

To estimate the cost of an execution plan, it uses:

  • When the data is obtained from a database, the indexes of the queried tables in the database.

  • Statistics about the views’ data: number of rows, number of NULL values of each field, etc.

    To obtain the statistics of JDBC base views, Virtual DataPort can query the system tables of the database. Alternatively, it can also query the view with a SELECT statement to obtain these statistics

In this section, we describe the cost-based optimization support and provide some tips to use it effectively: