The Fifth Elephant 2026 Annual Conference

The Fifth Elephant 2026 Annual Conference

Built for humans. Now rebuilding for agents.

Tickets

Loading…

Amaan Shaikh

Amaan Shaikh

@amaans

Billboards near a coffee shop: making proximity search fast in ClickHouse

Submitted Jun 24, 2026

Title

Billboards near a coffee shop: making proximity search fast in ClickHouse

Session description

We build planning software for out-of-home advertising: billboards, and the places people want to be near. Almost everything comes back to one query, show me the billboards near our coffee shops, and it sounds simpler than it is. There are about three million billboards on one side, twenty million places on the other, and “near” is not one number, it changes with every search. Big on both sides, with a radius that keeps moving, it is the kind of query an analytics engine is worst at, and every easy way to speed it up fell apart.

This is the story of fixing that one query. We tried the obvious things first, and each one hit a wall. What actually worked was not a faster query, it was a different question: we changed what we were asking, and ClickHouse happened to have the one thing that made the new question cheap. I will walk through what we tried, why it broke, the idea that fixed it, and the two lessons I would take to any hard join.

Takeaways

  • Know when, and how much, to precompute. The obvious precompute can cost more than it saves.
  • Change the question, not the query. Often the fix is not a faster query but a different one.

Who is this for

Data and platform engineers who serve queries at scale, anyone doing geospatial or proximity search, and anyone who likes a good battle story. A little SQL helps.

Bio

Amaan is an engineer with four years of experience. He started a fullstack engineer, then moved into large-scale data, building and running data workflows on Spark, Airflow and ClickHouse, in Scala and Python. He now works on data infrastructure for an ad-tech analytics platform.

https://docs.google.com/presentation/d/1Z6mYKi6feA1fkSjqTOSW4RzUQAjCKQAD/

Comments

{{ gettext('Login to leave a comment') }}

{{ gettext('Post a comment…') }}
{{ gettext('New comment') }}
{{ formTitle }}

{{ errorMsg }}

{{ gettext('No comments posted yet') }}

Get your hybrid access ticket

Hosted by

Jumpstart better data engineering and AI futures

Supported by

Platinum Sponsor

Atlassian unleashes the potential of every team. Our agile & DevOps, IT service management and work management software helps teams organize, discuss, and compl

Platinum Sponsor

Sahaj is an artisanal technology services company crafting purpose-built AI and data-led solutions for businesses.

Gold Sponsor

Skyflow secures the flow of data across datastores, models, and agents. Enterprises turn to Skyflow as their runtime AI data control layer to protect sensitive

Bronze Sponsor

Internet infrastructure APIs for IP geolocation and more

Bronze Sponsor

Open Source Analytical Database for the AI era.