nsmcp::AccessAnalytics method maintain (protected)

 <instance of nsmcp::AccessAnalytics[i]> maintain

Defined in /usr/local/ns/tcl/nsmcp/lib/access-analytics.tcl

Testcases:
No testcase defined.
Source code:
set db ${:db}
set cutoff [:retentionCutoff]
:drop age $cutoff
set limit ${:maxRows}
set count ${:rowCount}
if {$count>$limit} {:drop rows 0 [expr {$count-$limit}]}
set pageSize [$db scalar {PRAGMA page_size}]
set cap [expr {int([${:database} cget -maxBytes]*0.45)}]
# Leave room for the next batch, indexes and eviction history.
while {([$db scalar {PRAGMA page_count}]-[$db scalar {PRAGMA freelist_count}])*$pageSize > $cap*0.8} {
    if {${:rowCount}==0} {error "SQLite cache exceeds budget and no analytics rows remain to evict"}
    :drop size 0 5000
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: