SAP Knowledge Base Article - Preview

3601639 - Performance issue when using TO_DECIMAL Function in SQL statement

Symptom

Similar SQL statement with big different performance for the execution.

  • Bad Case
    SELECT COUNT(1) FROM ACDOCA WHERE TIMESTAMP > TO_DECIMAL(TO_VARCHAR(ADD_SECONDS(CURRENT_TIMESTAMP, -900), 'YYYYMMDDHH24MISS' ));
  • Good Case
    SELECT COUNT(1) FROM ACDOCA WHERE TIMESTAMP> TO_DECIMAL(TO_VARCHAR(ADD_SECONDS(CURRENT_TIMESTAMP, -900), 'YYYYMMDDHH24MISS'), 15, 0)


Read more...

Environment

  • HANA database platform 1.0
  • HANA database platform 2.0

Product

SAP HANA, platform edition all versions

Keywords

data type, execution time, DECIMAL, SAP HANA, SQL statement, hash statement, SELECT COUNT. , KBA , HAN-DB-PERF , SAP HANA Database Performance , HAN-DB , SAP HANA Database , How To

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.