the query execution time is done in HANA depending on the engine you use (Calc engine vs SQL engine).
The plan viz will probably take longer to execute as it needs to generate the entire plan verbose and display it to you on the plan viz window.. i do not think this is abnormal. Further, the more executions you perform on the same query/data model, it will cache and then will be served from memory rather than having to calculate it for the first time.. again this is normal behavior in SAP HANA
This sounds very likely to be caused by comparing "apples to oranges".
The data preview generates a SQL statement including a TOP n clause, limiting not just how many records the front end actually reads, but telling the database how many records to be delivered as a maximum. This can have an impact on both the query plan but most definitively on the runtime of one of the most important query operators: materialisation.
With PlanViz (depending on the setting in HANA Studio) you don't the TOP n clause into your statements. Moreover, PlanViz will go on and fetch all results as part of the tracing (that's what PlanViz really is, an execution trace).
So, most commonly, PlanViz will cover more processing and thus the execution time will be longer than that in the data preview.
That's why it is important to realize that there is not really "the" performance of a view.
It's always the performance of the query against the view. Therefore, make sure to test the queries that will be used against the view - not just default SELECT * FROM or whatever the data preview gives you.
Add comment