CREATE TABLE comments ( id BIGSERIAL PRIMARY KEY, user_id BIGINT NOT NULL, sku BIGINT NOT NULL, text VARCHAR(255) NOT NULL, created_at TIMESTAMP(3) NOT NULL DEFAULT now() ); CREATE INDEX ON comments(sku, created_at DESC, user_id ASC); CREATE INDEX ON comments(user_id, created_at DESC);