Solved

Database table: Is there a (significant) performance difference between reading a view or a query?

  • 23 August 2021
  • 1 reply
  • 27 views

Userlevel 1
Badge

In AIMMS it is possible to read data from both a query, or a selected object (e.g. a view). I was wondering if there is a difference in performance between the two methods if the only goal is to read data.

In my case, I am considering reading data from a table valued function because that allows me to filter the data according to several parameters. An alternative is reading from a view, where the parameters would appear in the columns and then used as an ‘Index domain’ when reading the database table in AIMMS.

I’m generally interested in performance impact, best practices, and overall trade-offs between alternative data retrieval methods (given a database).

icon

Best answer by mohansx 31 August 2021, 19:48

@LowBjorn any performance difference would really be realized on the database side, and depends heavily on what kind of views you have stored, what db server you are using.

See for example, sql - Is a view faster than a simple query? - Stack Overflow

If you find a performance gain while working directly on the db server, you can expect to realize that when access that data from AIMMS as well. 

View original

1 reply

Userlevel 5
Badge +2

@LowBjorn any performance difference would really be realized on the database side, and depends heavily on what kind of views you have stored, what db server you are using.

See for example, sql - Is a view faster than a simple query? - Stack Overflow

If you find a performance gain while working directly on the db server, you can expect to realize that when access that data from AIMMS as well. 

Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator