|
| 1 | + |
| 2 | +=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= |
| 3 | +* Things left to done for the PostgreSQL * |
| 4 | += Genetic Query Optimization (GEQO) = |
| 5 | +* module implementation * |
| 6 | +=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= |
| 7 | +* Martin Utesch * Institute of Automatic Control * |
| 8 | += = University of Mining and Technology = |
| 9 | +* utesch@aut.tu-freiberg.de * Freiberg, Germany * |
| 10 | +=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= |
| 11 | + |
| 12 | + |
| 13 | +1.) Basic Improvements |
| 14 | +=============================================================== |
| 15 | + |
| 16 | +a) improve freeing of memory when query is already processed: |
| 17 | +------------------------------------------------------------- |
| 18 | +with large JOIN queries the computing time spent for the genetic query |
| 19 | +optimization seems to be a mere *fraction* of the time Postgres |
| 20 | +needs for freeing memory via routine 'MemoryContextFree', |
| 21 | +file 'backend/utils/mmgr/mcxt.c'; |
| 22 | +debugging showed that it get stucked in a loop of routine |
| 23 | +'OrderedElemPop', file 'backend/utils/mmgr/oset.c'; |
| 24 | +the same problems arise with long queries when using the normal |
| 25 | +Postgres query optimization algorithm; |
| 26 | + |
| 27 | +b) improve genetic algorithm parameter settings: |
| 28 | +------------------------------------------------ |
| 29 | +file 'backend/optimizer/geqo/geqo_params.c', routines |
| 30 | +'gimme_pool_size' and 'gimme_number_generations'; |
| 31 | +we have to find a compromise for the parameter settings |
| 32 | +to satisfy two competing demands: |
| 33 | +1. optimality of the query plan |
| 34 | +2. computing time |
| 35 | + |
| 36 | +c) find better solution for integer overflow: |
| 37 | +--------------------------------------------- |
| 38 | +file 'backend/optimizer/geqo/geqo_eval.c', routine |
| 39 | +'geqo_joinrel_size'; |
| 40 | +the present hack for MAXINT overflow is to set the Postgres integer |
| 41 | +value of 'rel->size' to its logarithm; |
| 42 | +modifications of 'struct Rel' in 'backend/nodes/relation.h' will |
| 43 | +surely have severe impacts on the whole PostgreSQL implementation. |
| 44 | + |
| 45 | +d) find solution for exhausted memory: |
| 46 | +-------------------------------------- |
| 47 | +that may occur with more than 10 relations involved in a query, |
| 48 | +file 'backend/optimizer/geqo/geqo_eval.c', routine |
| 49 | +'gimme_tree' which is recursively called; |
| 50 | +maybe I forgot something to be freed correctly, but I dunno what; |
| 51 | +of course the 'rel' data structure of the JOIN keeps growing and |
| 52 | +growing the more relations are packed into it; |
| 53 | +suggestions are welcome :-( |
| 54 | + |
| 55 | + |
| 56 | +2.) Further Improvements |
| 57 | +=============================================================== |
| 58 | +Enable bushy query tree processing within PostgreSQL; |
| 59 | +that may improve the quality of query plans. |