Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-6051

PostgreSQL Connector problem with ORDER BY

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 16.0
    • None
    • JDBC Connector, OData
    • None
    • Undefined

      We are using Teiid via OData and connected to a postgresql database. We found following problem:

      If a OData request uses the $orderby=x attribute Teiid generates a SQL query with ORDER BY x NULLS FIRST. This leads to a performance problem if the index of the column is created, as it is the default, wit NULLS LAST. The query runs slow for big tables because the index is not used.

       

       

      Perhaps this code must be changed but I am not sure:  

      https://github.com/teiid/teiid/blob/37780f87c42e9aaa990e09f7a1f3fb0703c2a9d4/connectors/jdbc/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java#L453

       

              rhn-engineering-shawkins Steven Hawkins
              treiboll Fabian Knoll (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: