Quantcast
Channel: SCN : Discussion List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 5653

Low performance of count(distinct) in SAP HANA

$
0
0

Hello!

I faced with low perfomance of COUNT(DISTINCT) combination in SAP HANA. Example:

 

SELECT COUNT(DISTINCT O.CARDNUMBER) AS "Quantity"

              ,O.SHOPNAME

  FROM OLAPFACTS O

  INNER JOIN OLAP_DATE OD ON O.DATEEXT = OD.DATEID

  WHERE OD.DATEVALUE >= '2013-07-15'

   AND OD.DATEVALUE <= ADD_DAYS('2013-07-15', 29)

   AND O.CARDTYPE = 1

  GROUP BY O.SHOPNAME

 

Table OLAPFACTS  has 8 bln rows

           OLAP_DATE has 5800 rows.

 

Result in SAP HANA - 8 minutes

Result in MS SQL     - 1 minute

 

When I remove DISTINCT from query result of SAP HANA is 3 seconds. But I need count quantity of unique values of CARDNUMBER.

 

Can you advise me any solution?

 

Thanks, Marat.


Viewing all articles
Browse latest Browse all 5653

Trending Articles