diff options
| author | Shulhan <ms@kilabit.info> | 2024-03-18 02:21:30 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2024-03-18 21:55:35 +0700 |
| commit | 2e619db979d76c3e478d0b0592a569a005dc18c0 (patch) | |
| tree | eb2778973272c96c9d545a0bb4f458a653dc9b51 /_database | |
| parent | e6fed3ef602c587602a7e1eb1de303a0aafdc527 (diff) | |
| download | haminer-2e619db979d76c3e478d0b0592a569a005dc18c0.tar.xz | |
all: auto migrate the database when using postgresql forwarder
Diffstat (limited to '_database')
| -rw-r--r-- | _database/0001_http_log.sql | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/_database/0001_http_log.sql b/_database/0001_http_log.sql new file mode 100644 index 0000000..47da300 --- /dev/null +++ b/_database/0001_http_log.sql @@ -0,0 +1,68 @@ +DROP TABLE IF EXISTS http_log CASCADE; + +CREATE TABLE http_log ( + request_date TIMESTAMP WITH TIME ZONE + +, client_ip VARCHAR + +, frontend_name VARCHAR +, backend_name VARCHAR +, server_name VARCHAR + +, http_proto VARCHAR +, http_method VARCHAR +, http_url VARCHAR +, http_query VARCHAR + +, header_request VARCHAR +, header_response VARCHAR + +, cookie_request VARCHAR +, cookie_response VARCHAR +, termination_state VARCHAR + +, bytes_read BIGINT + +, status_code INTEGER +, client_port INTEGER + +, time_request INTEGER +, time_wait INTEGER +, time_connect INTEGER +, time_response INTEGER +, time_all INTEGER + +, conn_active INTEGER +, conn_frontend INTEGER +, conn_backend INTEGER +, conn_server INTEGER +, retries INTEGER + +, server_queue INTEGER +, backend_queue INTEGER +); + +DROP INDEX IF EXISTS http_log_idx; + +CREATE INDEX IF NOT EXISTS http_log_idx ON http_log( + request_date +, client_ip +, frontend_name +, backend_name +, server_name +, http_proto +, http_method +, http_url +, termination_state +, status_code +); + +DROP INDEX IF EXISTS http_log_time_idx; + +CREATE INDEX IF NOT EXISTS http_log_time_idx ON http_log( + time_request +, time_wait +, time_connect +, time_response +, time_all +); |
