Werner Echezuria escribió:
> Buenas Tardes,
> 
> ¿Cual es el procedimiento de ordenamiento de un campo?, es decir, se que en
> el planner postgresql ingresa en el grouping_planner y de alli genera un
> path segun el order by ingresado, como estoy trabajando en un proyecto que
> genera un campo extra que no se encuentra en ninguna tabla (simplemente se
> crea un tragetentry en el parser y luego en el execscan se hace el cálculo),
> se me hace complicado el ordenamiento, creo que el problema lo tengo en este
> código:
> /*
>      * If we were not able to make the plan come out in the right order, add
>      * an explicit sort step.
>      */
>     if (parse->sortClause)
>     {
>         if (!pathkeys_contained_in(sort_pathkeys, current_pathkeys))
>         {
>             result_plan = (Plan *) make_sort_from_pathkeys(root,
>                                                            result_plan,
>                                                            sort_pathkeys,
>                                                            limit_tuples);
>             current_pathkeys = sort_pathkeys;
>         }
>     }
> 
> ¿como haria para incluir el sortpathkey en el currentpathkey?

Creo que lo que debes hacer es agregar un nuevo SortGroupClause en la
lista parse->sortClause, de manera que make_pathkeys_for_sortclauses the
agregue el pathkey ...

-- 
Alvaro Herrera                  http://www.amazon.com/gp/registry/5ZYLFMCVHXC
"The problem with the facetime model is not just that it's demoralizing, but
that the people pretending to work interrupt the ones actually working."
                                                           (Paul Graham)
--
TIP 10: no uses HTML en tu pregunta, seguro que quien responda no podrá leerlo

Responder a