Cache stats in the database (and auto-update them from cron)

This commit is contained in:
Yorhel 2012-07-18 10:21:13 +02:00
parent f6564dfd9c
commit 0738583243
3 changed files with 18 additions and 5 deletions

View file

@ -56,6 +56,8 @@ CREATE INDEX ON man (name);
CREATE TABLE man_index AS SELECT DISTINCT name, section FROM man;
CREATE INDEX ON man_index USING btree(lower(name) text_pattern_ops);
CREATE TABLE stats_cache AS SELECT count(distinct hash) AS hashes, count(distinct name) AS mans, count(*) AS files, count(distinct package) AS packages FROM man;
INSERT INTO systems (id, name, release, short, relorder) VALUES
(1, 'Arch Linux', NULL, 'arch', 0),