Limitations of Core Data Services (CDS):
While Core Data Services (CDS) is a powerful and flexible feature in SAP HANA for defining and consuming semantically rich data models, it does have some limitations:
Complexity in Join Operations:
CDS handles basic join operations well, but in some complex scenarios involving multiple joins, the generated SQL may not be as optimized as handcrafted SQL. Tuning options are limited in such cases.
Limited Support for Complex Calculations:
While CDS allows for the definition of calculated columns, there may be limitations in handling complex calculations compared to using SQLScript or stored procedures directly.
Advanced Data Processing:
CDS has limitations when it comes to advanced data processing scenarios, such as procedural logic or recursive queries. For such cases, additional scripting languages like SQLScript may be required.
Limited Control Over Indexing:
CDS has limited control over the indexing of tables. Developers may have more control over indexing when using SQLScript directly.
Certain Database Features Not Supported:
Some database-specific features or optimizations may not be directly supported by CDS. In such cases, developers might need to resort to using native SQL features.
How Table Functions Can Help:
Table functions in SAP HANA can complement CDS by addressing some of the limitations:
Procedural Logic:
Table functions allow developers to define procedural logic using SQLScript. This is beneficial in scenarios where complex calculations or advanced data processing is required.
Optimized Join Operations:
Developers can use table functions to perform optimized join operations, especially in cases where CDS-generated SQL may not provide the desired performance.
Advanced Data Processing:
Table functions support advanced data processing scenarios, including procedural logic and recursive queries, providing more flexibility than CDS alone.
Fine-Grained Indexing Control:
Developers have more control over indexing when using table functions, allowing for fine-tuning performance in specific scenarios.
Support for Database-Specific Features:
Table functions enable the use of database-specific features or optimizations that may not be directly supported by CDS.
Considerations:
While table functions provide additional flexibility, it's important to carefully consider the trade-offs. Combining CDS with table functions introduces a mix of declarative and procedural paradigms, and developers should choose the approach that best fits the requirements of the specific use case.
In many scenarios, CDS alone might be sufficient for defining semantically rich data models and leveraging its capabilities in a declarative manner. However, when facing specific limitations or requiring advanced data processing, developers can use table functions to complement and extend the functionality provided by CDS.