CDS Views’ performance series: how to speed up?

Photo of author
By INUI
| Updated on

Here’s how to polish your CDS Views to absurd performance levels.

From keeping things flat to pushing to the top to using associations.

So if you want to learn all about how to maximize the performance of your CDS Views, then you’re in the right place.

Let’s go!

Featured Cds Performance

Polishing your CDS Views for raw unbridled performance

This series is about getting the most out of your CDS Views, performance-wise.

Here, we start with some basic concepts so we all have the same understanding of the fundamentals.

Then, we’ll tackle CDS View performance optimizations post by post.

So, without further ado, let’s get started!

CDS Views explained (just so we are on the same page)

CDS Views are Views on the database, as the name implies.

Instead of looking at your entire database all at once, you have a silhouette (your CDS Views) which you lay on top of your database.

Now if you take a look at your database with the silhouette on top, you see only the parts of your database which the silhouette allows you to see.

You see only the elements that are necessary for what you want to achieve, like the necessary data for an OData service of an SAPUI5 application.

Here’s another analogy:

Imagine all the items in your kitchen in one huge pile.

(Your database with all its tables and fields.)

Now you want to cook something.

(The application for which you need data)

That would be quite hard because you would need to fetch the tools and ingredients for your meal from that messy pile first.

(You would need to somehow (that somehow is solved by CDS Views) select only the data from the database you need for the application you want to create.)

So instead of combing through that pile each time you want to prepare a meal, you sort all the kitchen tools and ingredients into their respective places in the kitchen.

(Here we go, CDS View, precisely.)

Like the milk goes into the fridge and the fries into the cabinet.

(Again, that’s what CDS Views do: they pick and sort database tables and their fields.)

This way, if you want to prepare a meal, you know exactly where to find the items you need for it.

(Your CDS Views select from the database precisely those tables and fields you need for your application.)

For example, if you create an SAPUI5 application to check the stock at your lemonade stand, then the CDS Views for that application would only select and connect tables and fields necessary for checking the stock at your lemonade stand.

Now, we should be on the same page when it comes to a basic understanding of CDS Views.

If you’re looking to geek out on CDS Views, here you go. (link missing)

Let’s put the VDM on top of that because CDS Views and the VDM go hand in hand.

Let’s go!

Mind the Virtual Data Model (again, just to keep us on the same track)

Again, the naming does us a favor here.

Virtual Data Model says it all:

The Virtual Data Model specifies how to organize your data–

the VDM specifies how to organize and structure your CDS Views for the requirement at hand, the data extraction for your application.

The VDM demands a certain hierarchical order and purpose-based restrictions for the CDS Views that need to be maintained.

In short, there are:

  • Consumption CDS Views: top layer that get consumed by, e.g., an application.
  • Composite CDS Views: in between layers to grab precisely those database tables and field you need.
  • Basic CDS Views: bottom layer that directly accesses database tables.

If you want to learn more about the VDM, see here. (link missing)

Let’s speed up those CDS Views

Okay.

Now let’s cut straight to the chase.

First things first.

General things to mind when it comes to speeding up CDS Views

There are a few general things you need to pay attention to while implementing CDS Views if you want the real secret CDS View sauce.

Let’s get started!

Leave a Comment