Table of Contents
Fetching ...

Timehash: Hierarchical Time Indexing for Efficient Business Hours Search

Jinoh Kim, Jaewon Son

TL;DR

Timehash is presented, a novel hierarchical time indexing algorithm that achieves over 99% reduction in index size compared to minute-level indexing while maintaining 100% precision and is generalizable to various temporal filtering problems in search systems, e-commerce, and reservation platforms.

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.

Timehash: Hierarchical Time Indexing for Efficient Business Hours Search

TL;DR

Timehash is presented, a novel hierarchical time indexing algorithm that achieves over 99% reduction in index size compared to minute-level indexing while maintaining 100% precision and is generalizable to various temporal filtering problems in search systems, e-commerce, and reservation platforms.

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.
Paper Structure (36 sections, 2 theorems, 2 equations, 2 figures, 9 tables, 1 algorithm)

This paper contains 36 sections, 2 theorems, 2 equations, 2 figures, 9 tables, 1 algorithm.

Key Result

theorem 1

Timehash guarantees zero false negatives. For any query time $t$ within a document's operating hours $[start, end]$, at least one query key will match at least one index key.

Figures (2)

  • Figure 1: Hierarchical decomposition of 08:00--21:00 into 4 keys.
  • Figure 2: Boundary handling for 11:40--21:00. Non-aligned boundaries require finer-level decomposition.

Theorems & Definitions (4)

  • theorem 1: Zero False Negatives
  • proof
  • theorem 2: Zero False Positives
  • proof