# Treetable in K3

Code

The algorithm-design and code-structure derive from the k4/q version described here.

An improved (and vastly more efficient) version in q combines treetable functionality with three-dimensional pivot tables and is implemented here.

The unoptimized k3 version scales comfortably to several million records in the underlying table with update frequencies in the 5-30 second range. Since k3 is single-threaded, gui-events such as drill-downs contend with real-time updates (if such there be) and rollup-calculations. In general, performance will be constrained by the usual factors: record-count, column-count, update-frequency, number of in-place sorts, rollup-function-cost, and the degree to which the table is unrolled.

Drilldown, programmer-defined rollup functions, recursive sorting, real-time update:

Functional foreground & background colors: