TOptimizingSqlDatabase
Performs optimizations to the execution of SQL quries before they are sent to the decorated database.
Inheritance
Level | Ancestor | Description |
---|---|---|
1 | TObject | Ultimate ancestor in a class hierarchy |
2 | TSqlStatementExecutor | Abstract base class for a facility that executes a TSqlStatement |
3 | TSqlDatabase | Abstract base class for connections to databases that can be queried using SQL statements. |
4 | TLogicalSqlDatabase |
Abstract base class for TSqlDatabase implementations that manipulate or translate queries before they sent to an
actual physical TSqlDatabase .
|
5 | TOptimizingSqlDatabase |
Source
Sql.Database.Logical.Optimizing.pas (70)
Description
Some database systems may not optimize every query as one would expect. TOptimizingSqlDatabase
provides some optimizations that are
found to be lacking from external database systems. For instance, queries of the form
SELECT COUNT(*) FROM (SELECT ... FROM ...) AS table WHERE table.ID=...
sometimes are executed by first evaluating the inner SELECT
in its entirety and then applying the WHERE
from the outer SELECT
. In many cases it is possible to push down the restrictions from
the outer query to the inner query.
Methods
Scope | Visibility | Result | Name | Description |
---|---|---|---|---|
Instance | private | TSqlResult | HandleDecoratedStatement(Statement: TSqlStatement; ResultMethod: TSqlQueryResultMethod) | |
Instance | public | TSqlResult | Query(Statement: TSqlStatement; ResultMethod: TSqlQueryResultMethod) |