mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-30 02:32:42 +01:00
0dee34b3fa
Summary: Ref T13083. Facts has a fair amount of weird hardcoding and duplication of responsibilities. Reduce this somewhat: no more hard-coded fact aggregates, no more database-driven list of available facts, etc. Generally, derive all objective truth from FactEngines. This is more similar to how most other modern applications work. For clarity, hopefully: rename "FactSpec" to "Fact". Rename "RawFact" to "Datapoint". Split the fairly optimistic "RawFact" table into an "IntDatapoint" table with less stuff in it, then dimension tables for the object PHIDs and key names. This is primarily aimed at reducing the row size of each datapoint. At the time I originally wrote this code we hadn't experimented much with storing similar data in multiple tables, but this is now more common and has worked well elsewhere (CustomFields, Edges, Ferret) so I don't anticipate this causing issues. If we need more complex or multidimension/multivalue tables later we can accommodate them. The queries a single table supports (like "all facts of all kinds in some time window") don't make any sense as far as I can tell and could likely be UNION ALL'd anyway. Remove all the aggregation stuff for now, it's not really clear to me what this should look like. Test Plan: Ran `bin/fact analyze` and viewed web UI. Nothing exploded too violently. Subscribers: yelirekim Maniphest Tasks: T13083 Differential Revision: https://secure.phabricator.com/D19119
5 lines
241 B
SQL
5 lines
241 B
SQL
CREATE TABLE {$NAMESPACE}_fact.fact_keydimension (
|
|
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
|
factKey VARCHAR(64) NOT NULL COLLATE {$COLLATE_TEXT},
|
|
UNIQUE KEY `key_factkey` (factKey)
|
|
) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
|