A system from processing database queries allows for cost and locale based distribution
for execution of database queries. The database queries are executed on execution
engines that provide flexible configuration and overlapping functionality. The
system reduces various costs, including elapsed time, required to perform database
queries. The system provides processing of a database query using a database catalog
comprising database table locality information, record locality information and
execution engine information. A query optimizer receives the query and accesses
the database catalog to create a query execution plan comprising locality-based
database operations. A central database operation processor providing a first execution
engine executes the query execution plan by performing at least a portion of the
locality-based database operations and distributing at least a portion of the locality-based
database operations as a subplan. A second database operation processor providing
a second execution engine executes the subplan received from the central database
operation processor. At least one of the database operations can be executed on
either the first execution engine or the second execution engine. A storage unit
stores at least a portion of database tables and records. A data communications
network connects the central database processor to the second database processor.