From d5489eeb5af96c8cc52dff5f2b7c371759b3d381 Mon Sep 17 00:00:00 2001 From: Steffen Weinstock <79531202+stewsk@users.noreply.github.com> Date: Thu, 8 May 2025 16:24:00 +0200 Subject: [PATCH 1/2] (cds 9) No native HANA associations --- guides/databases-hana.md | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/guides/databases-hana.md b/guides/databases-hana.md index e81a4a192..84c677a5e 100644 --- a/guides/databases-hana.md +++ b/guides/databases-hana.md @@ -659,17 +659,18 @@ All limitations for the SAP HANA Cloud database can be found in the [SAP Help Po ### Native Associations -For SAP HANA, CDS associations are by default reflected in the respective database tables and views -by _Native HANA Associations_ (HANA SQL clause `WITH ASSOCIATIONS`). - -CAP no longer needs these native associations (provided you use the new database -service _@cap-js/hana_ for the CAP Node.js stack). - -Unless you explicitly use them in other native HANA objects, we recommend -switching off the generation of native HANA associations, as they increase deploy times: +In previous CAP releases, CDS associations were by default reflected in the respective SAP HANA +database tables and views by _Native HANA Associations_ (HANA SQL clause `WITH ASSOCIATIONS`). +But the presence of such native associations increases (re-)deploy times: They need to be validated in the HDI deployment, and they can introduce indirect dependencies between other objects, which can trigger other unnecessary revalidations -or even unnecessary drop/create of indexes. By switching them off, all this effort is saved. +or even unnecessary drop/create of indexes. + +As CAP doesn't need these native associations, by default no native HANA associations +are created any more. + +In the unlikely case that you explicitly use them in other native HANA objects or in custom code, +you can switch them back on: ::: code-group @@ -677,7 +678,7 @@ or even unnecessary drop/create of indexes. By switching them off, all this effo { "cds": { "sql": { - "native_hana_associations": false + "native_hana_associations": true } } } @@ -686,7 +687,7 @@ or even unnecessary drop/create of indexes. By switching them off, all this effo ```json [cdsrc.json] { "sql": { - "native_hana_associations": false + "native_hana_associations": true } } ``` @@ -694,13 +695,10 @@ or even unnecessary drop/create of indexes. By switching them off, all this effo ::: -For new projects, `cds add hana` automatically adds this configuration. - ::: warning Initial full table migration -Be aware, that the first deployment after this **configuration change may take longer**. +Be aware that the first deployment after this **configuration change may take longer**. For each entity with associations, the respective database object will be touched (DROP/CREATE for views, full table migration via shadow table and data copy for tables). -This is also the reason why we haven't changed the default so far. -Subsequent deployments will benefit, however. + ::: From 69a07b4569861b01aefa6118d7f1b0ab66f4edfa Mon Sep 17 00:00:00 2001 From: Steffen Weinstock <79531202+stewsk@users.noreply.github.com> Date: Fri, 9 May 2025 14:44:04 +0200 Subject: [PATCH 2/2] Update guides/databases-hana.md Co-authored-by: Andre Meyering --- guides/databases-hana.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/databases-hana.md b/guides/databases-hana.md index 84c677a5e..8f52e9d05 100644 --- a/guides/databases-hana.md +++ b/guides/databases-hana.md @@ -667,7 +667,7 @@ indirect dependencies between other objects, which can trigger other unnecessary or even unnecessary drop/create of indexes. As CAP doesn't need these native associations, by default no native HANA associations -are created any more. +are created anymore starting with CAP 9. In the unlikely case that you explicitly use them in other native HANA objects or in custom code, you can switch them back on: