How sharp are your ClickHouse® skills?

​​You could win this T-shirt… but only if you beat us. 😉


Write a ClickHouse query that would return the 1000th natural number that is both:

  1. A prime number by itself;
  2. The sum of its digits is also a prime number

Our engineers got the query to run in under 200 milliseconds. Think you can beat this? Here’s what to do:

*please see rules below*

PS. If you need inspiration, you can see some past submissions on Slack (some queries are running under 10 ms) 👀


To snag a t-shirt, you’ll need to follow a few rules.

  • Post your query in the channel #clickhousepuzzle on Slack. The query must be different than what has already been posted.
  • The query must be faster than 200 ms.
  • Bragging rights – you beat an Altinity engineer.
  • Our T-shirts are really comfy.
  • A T-shirt won by coding is worth ten bought in a store.