Skip to main content
QUICK REVIEW

[Paper Review] Timehash: Hierarchical Time Indexing for Efficient Business Hours Search

Jinoh Kim, Jaewon Son|arXiv (Cornell University)|Mar 3, 2026
Time Series Analysis and ForecastingComputer Science0 citations
TL;DR

Timehash introduces a hierarchical, multi-resolution time indexing method that drastically reduces index size while preserving minute-level precision and 100% recall/precision for business hours search.

ABSTRACT

Temporal range filtering is a critical operation in large-scale search systems, particularly for location-based services that need to filter businesses by operating hours. Traditional approaches either suffer from poor query performance (scope filtering) or index size explosion (minute-level indexing). We present Timehash, a novel hierarchical time indexing algorithm that achieves over 99% reduction in index size compared to minute-level indexing while maintaining 100% precision. Timehash employs a flexible multi-resolution strategy with customizable hierarchical levels. Through empirical analysis on distributions from 12.6 million business records of a production location search service, we demonstrate a data-driven methodology for selecting optimal hierarchies tailored to specific data distributions. We evaluated Timehash on up to 12.6 million synthetic POIs generated from production distributions. Experimental results show that a five-level hierarchy reduces index terms to 5.6 per document (99.1% reduction versus minute-level indexing), with zero false positives and zero false negatives. Scalability benchmarks confirm constant per-document cost from 100K to 12.6M POIs, while supporting complex scenarios such as break times and irregular schedules. Our approach is generalizable to various temporal filtering problems in search systems, e-commerce, and reservation platforms.

Motivation & Objective

  • Formalize the temporal range indexing problem for business hours search in large-scale inverted indexes.
  • Propose Timehash, a hierarchical multi-resolution algorithm that decomposes time ranges into scalable, human-readable time buckets.
  • Demonstrate data-driven methods to select optimal hierarchies tailored to real data distributions.
  • Prove theoretical space and correctness guarantees and validate scalability on production-scale data.

Proposed method

  • Define a hierarchical set of time granularities (e.g., 4h, 1h, 15m, 5m, 1m) and greedily cover time ranges with the largest fitting block at each step.
  • Generate multiple timehash keys representing a time range that preserve minute-level precision.
  • Generate query keys at all hierarchy levels to ensure complete recall for point queries and support range queries.
  • Prove space complexity is O(T/m1) and show a small, constant bound on the number of keys (at most 28 for the tested hierarchy).
  • Provide a C++ library implementation with functions getIndexTerms(from, to) and getQueryTerms(hhmm).
  • Validate the approach on up to 12.6 million synthetic/production POIs, demonstrating 99.1% index size reduction and zero false positives/negatives.

Experimental results

Research questions

  • RQ1How can temporal range filtering for business hours be achieved with small index size while maintaining minute-level precision?
  • RQ2Can a hierarchical, multi-resolution encoding reduce the number of index terms per document without sacrificing correctness?
  • RQ3What is the theoretical space and query complexity of Timehash, and how does it perform on real production data?
  • RQ4How should one select optimal hierarchies for a given temporal distribution to balance size and precision?
  • RQ5Can Timehash handle complex patterns like break times, irregular schedules, and overnight ranges while remaining efficient?

Key findings

  • A five-level hierarchy (4-hour, 1-hour, 15-minute, 5-minute, 1-minute) achieves the best tradeoff between index size and precision.
  • Timehash reduces index terms per document from minute-level indexing by 99.1% (to 5 keys in the example) with zero false positives and zero false negatives.
  • Space complexity is O(T/m1), representing a constant-factor reduction over naive minute-level indexing, with worst-case key count empirical bound of 28 (vs 1,440 minutes).
  • The approach supports break times, irregular schedules, and 24-hour operations, and scales linearly from 100k to 12.6M POIs.
  • Production deployment covered 18 months and indexed 12.6 million POIs, with timing and reliability suitable for production search workloads.
  • Code and artifacts are available at the provided GitHub repository for reproducibility.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.