Skip to content

Instantly share code, notes, and snippets.

@whitequark
Created August 26, 2016 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whitequark/4a26952a116371e528c00801397f7e88 to your computer and use it in GitHub Desktop.
Save whitequark/4a26952a116371e528c00801397f7e88 to your computer and use it in GitHub Desktop.
DROP TABLE IF EXISTS irclog;
CREATE TABLE irclog (
id SERIAL,
channel VARCHAR(30),
nick VARCHAR(40),
opcode VARCHAR(20),
timestamp INT,
line TEXT,
oper_nick VARCHAR(40),
payload TEXT,
PRIMARY KEY(id)
);
CREATE INDEX irclog_channel ON irclog (channel);
CREATE INDEX irclog_channel_timestamp_index ON irclog (channel, timestamp);
CREATE INDEX irclog_channel_opcode_index ON irclog (channel, opcode);
CREATE INDEX irclog_channel_nick_index ON irclog (channel, nick);
CREATE INDEX irclog_fulltext_index ON irclog
USING gin(to_tsvector('english', nick || ' ' || line));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment