18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
-
+
|
create table rsstg_post (
source_id integer not null,
posted timestamptz not null,
url text not null,
hour smallint not null generated always as (extract('hour' from posted at time zone 'utc')) stored,
hxm smallint not null generated always as (hxm(posted)) stored,
FOREIGN KEY (source_id) REFERENCES rsstg_source(source_id) on delete cascade,
FOREIGN KEY (source_id) REFERENCES rsstg_source(source_id) on delete cascade
);
create unique index rsstg_post__url on rsstg_post(url);
create index rsstg_post__hour on rsstg_post(hour);
create index rsstg_post__posted_hour on rsstg_post(posted,hour);
create index rsstg_post__hxm on rsstg_post(hxm);
create index rsstg_post__posted_hxm on rsstg_post(posted,hxm);
|