diff options
| author | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2026-04-23 10:11:13 +0100 |
|---|---|---|
| committer | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2026-04-23 10:11:13 +0100 |
| commit | 7c59f2b66284b5b561c5368a0c834640ae0e611e (patch) | |
| tree | 52283c0147c33317e0683638ab88ae1828a91b20 /src/schema.sql | |
| parent | 7a66f1241f4a6ec570a5c41490ee3698eeeaf66e (diff) | |
| download | webstat-7c59f2b66284b5b561c5368a0c834640ae0e611e.tar.bz2 webstat-7c59f2b66284b5b561c5368a0c834640ae0e611e.tar.xz webstat-7c59f2b66284b5b561c5368a0c834640ae0e611e.zip | |
Add BRIN index to access_log.request_time and improve purge
Purge is now fully request_time based and not hacked around id ranges.
Diffstat (limited to 'src/schema.sql')
| -rw-r--r-- | src/schema.sql | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/schema.sql b/src/schema.sql index b211505..9d39bcd 100644 --- a/src/schema.sql +++ b/src/schema.sql @@ -107,6 +107,8 @@ CREATE TABLE access_log( CONSTRAINT fk_access_log_content_type FOREIGN KEY (content_type) REFERENCES entities(id) ON UPDATE CASCADE ); +CREATE INDEX idx_access_log_request_time ON access_log USING BRIN(request_time) WITH (autosummarize = TRUE); + CREATE OR REPLACE VIEW access_log_view AS SELECT l.id, |
