How efficient are my table selection operations?
How much memory do my select and update operations waste? Are they efficient?
select and update create in-memory columns of data, whereas view, updateView, and lazyUpdate do not.
Deephaven recommends using select and update when calculations are expensive, or the results are needed for multiple downstream operations. These methods can cause issues when data gets sufficiently large, as they can consume a lot of memory.
How efficient are your select and update operations? This page gives you a query to run in the Deephaven console to find out.
To better understand how efficient your memory usage is, execute the following Groovy code:
An efficiency of 100% means that the selection operations are perfectly efficient - there is no wasted memory. This is the ideal case.
Tip: Perfect efficiency is not always possible, especially with complex or refreshing tables. Aim for higher efficiency, but don't worry if you can't reach 100% in every case.
An important detail about this code is that it checks memory efficiency for columns backed by a SparseArrayColumnSource. This does not apply to all columns. The simplest way to construct a table with columns backed by these is to create a non-flat refreshing table with in-memory columns. You can force all columns into memory with select.
Note
A "flat" table has a flat row set. That means the row set increases monotonically from 0 to the number of rows minus one with no gaps.