Skip to content

Instantly share code, notes, and snippets.

@atvanguard
Created January 23, 2018 18:05
Show Gist options
  • Save atvanguard/b18df9f82f2f3a410d73f7d6af3aa35a to your computer and use it in GitHub Desktop.
Save atvanguard/b18df9f82f2f3a410d73f7d6af3aa35a to your computer and use it in GitHub Desktop.
api_logs=# \d+ logs
Table "public.logs"
Column | Type | Modifiers | Storage | Stats target | Description
------------+-----------------------------+---------------+----------+--------------+-------------
id | bigint | not null | plain | |
api_key | character varying | not null | extended | |
statuscode | integer | | plain | |
latency | integer | | plain | |
method | character varying | | extended | |
created_at | timestamp without time zone | default now() | plain | |
Indexes:
"logs_pkey" PRIMARY KEY, btree (id)
"api_key_idx" btree (api_key)
"api_key_time_idx" btree (api_key, created_at)
"time_idx" btree (created_at)
Triggers:
insert_logs_trigger BEFORE INSERT ON logs FOR EACH ROW EXECUTE PROCEDURE logs_insert_trigger()
Child tables: logs_201709,
logs_201710
api_logs=# \d+ logs_201709
Table "public.logs_201709"
Column | Type | Modifiers | Storage | Stats target | Description
------------+-----------------------------+---------------+----------+--------------+-------------
id | bigint | not null | plain | |
api_key | character varying | not null | extended | |
statuscode | integer | | plain | |
latency | integer | | plain | |
method | character varying | | extended | |
created_at | timestamp without time zone | default now() | plain | |
Indexes:
"logs_201709_pkey" PRIMARY KEY, btree (id)
"logs_201709_api_key_idx" btree (api_key)
"logs_201709_api_key_time_idx" btree (api_key, created_at)
"logs_201709_time_idx" btree (created_at)
Check constraints:
"logs_201709_time_check" CHECK (created_at < '2017-10-01 00:00:00'::timestamp without time zone)
Inherits: logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment