Result Set Caching
Drillbridge can cache the results of a drill-through query. This is a per-report setting, Use caching, found with the other report options.
When it is turned on, the first execution of the report runs the query, then compresses the whole result set and stores it in the BLOB server. The report is rendered from that stored copy, and so is anything that asks for the same results again, such as downloading them as Excel or CSV. The query is not run a second time. Cached results are held for fifteen minutes.
This is worth turning on for a report whose query takes a noticeable amount of time to run and whose results are not enormous, particularly when users routinely download the results after viewing them. It is not worth turning on for a fast query, where storing and re-reading the results costs more than running the query again.
|
Caching does not break the results into pages. Earlier versions of this manual
described paging through a cached result set with Next and Previous buttons,
and earlier releases offered a Rows per page report option and |
BLOB Servers
A BLOB object is a "binary large object". As it pertains to Drillbridge, the compressed rows of data are turned into a binary object. Additionally, BLOB is a column type in a relational data store. Drillbridge can be configured to store BLOB (temporary result sets) in one of two places: either locally (using memory), or in a relational database. If Drillbridge is configured to store BLOB/cache data in a database, then a connection must be specified and tables must be created for Drillbridge to use.
BLOB Server Configuration
Create a database as normal using the tool for your RDBMS. You may wish to create a new user specifically for Drillbridge caching. Then, create tables using the DDL for your database vendor as noted below. There is no initial data that needs to be populated into the tables. Drillbridge will populate the tables as needed as cached results need to be stored.
H2 Database Configuration
CREATE TABLE `DRB_PAGE_CACHE` (
`SESSION_ID` int(11) NOT NULL,
`SERVER_TAG` int(11) NOT NULL,
`PAGE_NUM` int(11) NOT NULL,
`DATA` blob NOT NULL,
PRIMARY KEY (`SESSION_ID`, `SERVER_TAG`, `PAGE_NUM`)
);
CREATE TABLE `DRB_SESSION_CACHE` (
`SESSION_ID` int(11) NOT NULL,
`SERVER_TAG` int(11) NOT NULL,
`CREATED` timestamp NOT NULL,
`LAST_ACCESSED` timestamp NOT NULL,
PRIMARY KEY(`SESSION_ID`, `SERVER_TAG`)
);`
Drillbridge Cached Result Set Setup
After the database/schema has been created/configured to store BLOB results, some configuration changes must then be made to Drillbridge to activate the use of the schema and turn on the caching feature. Note that database configuration does not need to be performed if the "In Memory" result caching feature is used. That said, it is not recommend to use the In Memory option in a production environment.
In order to configure result caching, edit the application.properties file in the /config sub-folder of your Drillbridge installation.
Find the following configuration entries:
dtb.cache.pov.max-entries=10000
dtb.cache.pov.expire-minutes=15
dtb.blobserver.cleanup-interval=600000
dtb.blobserver.cleanup-enabled=true
dtb.blobserver.initial-delay=300
dtb.blobserver.period=60
# Choose INMEM or JDBC or CONN
dtb.blobserver.type=INMEM
dtb.blobserver.url=jdbc:mysql://diskstation.corp.saxifrages.com/drilluser?noDatetimeStringSync=true
dtb.blobserver.username=drilluser
dtb.blobserver.password=drillpass
Note that Drillbridge must be stopped and started in order for changes to the configuration to take effect.