JIT timestamp IN with 40 or more intervals is slower than the Java filter

Aperta
#8,263 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java

Direzione di ricerca

Start with CompiledFilterIRSerializer.java at the TIMESTAMP key limit and serializeInTimestampRange, then compare its generated checks with IntervalUtils.findInterval and the DATE key cap. Reproduce the reported timings for interval counts around the 10–40 crossover, including the designated-column OR case. Done when the JIT avoids the reported slowdown for long interval lists without losing its reported advantage at 10 intervals.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

A4. JIT timestamp IN with 40 or more intervals is slower than the Java filter
  • Net impact: filters with many intervals run up to 14x slower with the JIT on.

  • Location:

    • CompiledFilterIRSerializer.java:5475-5489 leaves TIMESTAMP keys uncapped (Integer.MAX_VALUE).
    • serializeInTimestampRange (:4969-5059) emits one range check per interval.
    • The Java filter binary-searches the intervals instead (IntervalUtils.findInterval).
  • Symptom: 5M rows, non-designated tm, tm IN '2024-01-01T09:00;1h;1d;N'. Times with the JIT on and off, at head (base):

    N JIT on JIT off
    10 17 ms (16 ms) 37 ms (25 ms)
    40 72 ms (72 ms) 59 ms (37 ms)
    100 181 ms (180 ms) 80 ms (50 ms)
    300 757 ms (779 ms) 142 ms (90 ms)
    • On 8 workers, N = 300 takes 81 ms with the JIT and 13.5 ms without.
    • The JIT wins at N = 10, so the crossover lies between 10 and 40.
  • Origin: pre-existing.

  • Reachability: the default JIT mode, a temporal IN over an interval expression with 40 or more intervals on a non-designated column, or on the designated one under OR.

  • Suggested fix: cap TIMESTAMP keys at a limit derived from the crossover, as the PR caps DATE keys, or emit a binary search for long interval lists.

  • Severity if filed standalone: Critical (data-path performance).

Lingua principale
Java
Stelle
17.5k
Fork
1.7k
Merge medio
5g 11h
PR unite (30g)
64

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di questdb/questdb

Tutte le issue di questdb/questdb

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.