Skip to Content

Duplicates on SELECT DISTINCT statement in HANA DB

Hello everyone,

I'm trying to figure out if the DISTINCT statement, with a list of fields, on HANA DB without the ORDER BY statement in the SELECT, may be source of inconsistencies in the uploaded data.

In HANA data they are loaded into memory, but you can know whether it is technically possible that duplicate records are loaded, In the face of standard code that uses the DISTINCT instructions without any sort really?.

After upgrade, Standard code seems to use DISTINCT statements without any ORDER BY instruction.

Thanks for the attention, regards

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 30, 2017 at 11:54 AM

    If you are talking about Open SQL, the behavior of DISTINCT is described here.

    If you are talking about HANA SQL, the behavior of DISTINCT is described here.

    There's no dependency from the ORDER BY clause mentioned there.

    The SAP HANA Database offers an SQL interface to its relational databases that is generally independent from HANA's internal memory management and which behaves like standard SQL for the most part.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Horst, we developed a report to get some statistic using best golden rules and we get same result in time of before.

      Every kind of selection with many rows (like SELECT - ENDSELECT, SELECT * , SELECT FOR ALL ENTRIES, OPEN CURSOR with FETCH, JOIN, etc..), is much longer than before in Oracle. We're trying to find out if it's a problem related to DB Proxy access time .

      I verified that the quantity of records needs same percentage of time in HANA and ORACLE, (double perc. in the first selections and quite the same perc. in the end) but the time to read data is much more expensive.

      Do you know how to check this?

      Thanks a lot Roberto

  • Jan 30, 2017 at 12:28 PM

    Please check if the mandt (client) is used in the select qwery.

    Best Regards,


    Add comment
    10|10000 characters needed characters exceeded

    • Hi,

      I was talking about HANA development (native) not from ABAP end.

      I was thinking if you are using native query n getting multiple results that might be because of data from different client. So i suggested. Anyways i think you are getting many replies so hopefully you will get your solution.