Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-2894

Study how to solve "ORDER BY FUNC(field)"

    XMLWordPrintable

Details

    • Story
    • Status: To Do
    • Resolution: Unresolved
    • None
    • Qserv
    • None

    Description

      This problem is complex. This ticket aims at breaking it down in simpler tasks.

      Attachments

        Issue Links

          Activity

            ktl Kian-Tat Lim added a comment - - edited

            I'm not sure why this is so hard. At first glance, I would say we should (eventually) do this:

            • For each column or expression in the ORDER BY clause, add "expr AS _qserv_orderby_{n}" to the SELECT clause for the worker queries (but not the czar/aggregate query).
            • Replace each column or expression in the ORDER BY clause by "_qserv_orderby_{n}".
            • Remove the ORDER BY clause from the worker queries, as it isn't particularly useful.

            As a later optimization, we could leave the ORDER BY clauses in the worker queries and do a merge sort (with column removal) in the czar's C++ (or Python) code without invoking MySQL.

            ktl Kian-Tat Lim added a comment - - edited I'm not sure why this is so hard. At first glance, I would say we should (eventually) do this: For each column or expression in the ORDER BY clause, add "expr AS _qserv_orderby_{n}" to the SELECT clause for the worker queries (but not the czar/aggregate query). Replace each column or expression in the ORDER BY clause by "_qserv_orderby_{n}". Remove the ORDER BY clause from the worker queries, as it isn't particularly useful. As a later optimization, we could leave the ORDER BY clauses in the worker queries and do a merge sort (with column removal) in the czar's C++ (or Python) code without invoking MySQL.

            The plan is to add appropriate alias to SELECT and then remove it. Details in DM-2859

            jbecla Jacek Becla (Inactive) added a comment - The plan is to add appropriate alias to SELECT and then remove it. Details in DM-2859

            Please note that this ticket is about parsing ORDER BY FUNC(field), not managing ORDER BY in general, I re-open it.

            jammes Fabrice Jammes added a comment - Please note that this ticket is about parsing ORDER BY FUNC(field), not managing ORDER BY in general, I re-open it.

            People

              fritzm Fritz Mueller
              jammes Fabrice Jammes
              Fabrice Jammes, Jacek Becla (Inactive), Kian-Tat Lim
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Jenkins

                  No builds found.