Skip to content

Instantly share code, notes, and snippets.

@alq666
Last active December 21, 2015 09:08
Show Gist options
  • Save alq666/6282597 to your computer and use it in GitHub Desktop.
Save alq666/6282597 to your computer and use it in GitHub Desktop.
SELECT c.key,
c.x_key,
c.tags,
x.name
FROM context c
JOIN x
ON c.x_key = x.key
WHERE c.key = ANY (ARRAY[15368196, -- 11,000 other keys --)])
AND c.x_key = 1
AND c.tags @> ARRAY[E'blah'];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment