Uploaded image for project: 'Apache HAWQ (Retired)'
  1. Apache HAWQ (Retired)
  2. HAWQ-1513

"string_agg" function does not support query optimization on partitioned table

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Catalog
    • None

    Description

      The table "t1" is partitioned by field "create_time".
      query sql statement:
      SELECT
      mid,
      COUNT (mid),
      string_agg (
      create_time ,|| '#' || s_id
      ORDER BY
      create_time
      )
      FROM
      t1
      WHERE
      t1.create_time BETWEEN to_timestamp(
      '2016-12-19 00:20:00:770',
      'yyyy-MM-dd HH24:MI:ss.ff'
      )
      AND to_timestamp(
      '2016-12-19 23:40:00:770',
      'yyyy-MM-dd HH24:MI:ss.ff'
      )group by mid;

      when we explain the sql statement, we find it scan all the partition of table t1 in the query plan, and it has a huge impact on the query performance.
      what can i do to solve this problem?
      Thanks!

      Attachments

        Activity

          People

            rlei Radar Da Lei
            lynnyuan lynn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: