Genetic Query Optimization (GEQO) in PostgreSQL

The GEQO module is intended for the solution of the query optimization problem similar to a traveling salesman problem (TSP). Possible query plans are encoded as integer strings. Each string represents the join order from one relation of the query to the next. For example, the query tree
   /\
  /\ 2
 /\ 3
4  1
is encoded by the integer string '4-1-3-2', which means, first join relation '4' and '1', then '3', and then '2', where 1, 2, 3, 4 are relids within the PostgreSQL optimizer.

Specific characteristics of the GEQO implementation in PostgreSQL are:

The GEQO module allows the PostgreSQL query optimizer to support large join queries effectively through non-exhaustive search.