Difference between revisions of "Database Table: site stats"

From Dreamwidth Notes
Jump to: navigation, search
(Robot: Updating: Format, needs desc)
(Robot: Updating: Format)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Database Table|name=site_stats|table type=global|need desc=1}}
+
{{Database Table|name=site_stats|table type=global|need desc=1|repo=dw-free}}
 
= Definition =
 
= Definition =
 
<source lang="sql">
 
<source lang="sql">
Line 11: Line 11:
 
     -- maybe not as good if we want all keys for the category, with a limit on
 
     -- maybe not as good if we want all keys for the category, with a limit on
 
     -- time (ie, last 5 entries, or last 2 weeks). Do we need an extra index?
 
     -- time (ie, last 5 entries, or last 2 weeks). Do we need an extra index?
     INDEX (category_id, key_id, insert_time)  
+
     INDEX (category_id, key_id, insert_time)
 
)
 
)
 
</source>
 
</source>
 
{{Database Table Footer}}
 
{{Database Table Footer}}

Latest revision as of 15:58, 22 July 2010

This is a global table.

Definition

CREATE TABLE site_stats (
    category_id INT UNSIGNED NOT NULL,
    key_id INT UNSIGNED NOT NULL,
    insert_time INT UNSIGNED NOT NULL,
    VALUE INT UNSIGNED NOT NULL,
 
    -- FIXME: This is good for retrieving data for a single category+key, but
    -- maybe not as good if we want all keys for the category, with a limit on
    -- time (ie, last 5 entries, or last 2 weeks). Do we need an extra index?
    INDEX (category_id, key_id, insert_time)
)

Relationships