cache_id INT(11) unsigned not_null auto_increment comment(Primary key - unique identifier for each cached calculation)
expression VARCHAR(500) not_null comment(Mathematical expression that was calculated)
expression_hash VARCHAR(64) not_null comment(MD5 hash of expression for fast lookup and deduplication)
result DOUBLE not_null comment(Calculated result value)
result_type VARCHAR(50) not_null comment(Type of result - number, percentage, currency, etc.)
variables JSON default null comment(Variables used in the calculation (JSON format))
execution_time FLOAT not_null comment(Time taken to execute calculation in milliseconds)
created_at DATETIME not_null comment(When the calculation was first cached)
last_accessed DATETIME not_null comment(Last time this cached result was accessed)
access_count INT(11) unsigned default 0 comment(Number of times this cached result has been reused)

--
primary cache_id
unique idx_expression_hash expression_hash
idx_created_at created_at
idx_last_accessed last_accessed
##
engine innodb
character_set utf8mb4
collate utf8mb4_unicode_ci