a join on `period CONTAINS point` should bound the probe scan as the period form does
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 28/100
Direzione di ricerca
Start with optimise-contains-period-predicate, the planner rule that rewrites contains? over two period constructors, and its TODO about the point form. Check temporal-contains-point? for the intended semantics, and how recall-with-cast2 casts timestamp-local and date points. Done means a point-form contains? in a join condition yields comparison bounds on the probe scan, with tests per point type (timestamp-tz, timestamp, date) across a DST overlap, such as the contains-precedence-bug-3473 test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
A join on a period containing a point — b._valid_time CONTAINS a._valid_from — reaches the join as an opaque contains? call, so the probe scan gets no valid-time bound from it, where the period-against-period form does.
-
The planner rewrites
CONTAINSto comparisons only when both arguments are period constructors.
optimise-contains-period-predicateturns(contains? (period f1 t1) (period f2 t2))into<=/>=over the ends, and leaves(contains? (period f t) x)alone; its own TODO anticipates the point form. -
The join can only read a bound from comparisons.
With the period form collapsed in join conditions,b._valid_time CONTAINS a._valid_timebecomesb._valid_from <= a._valid_fromandcoalesce(b._valid_to, eot) >= coalesce(a._valid_to, eot), which bound the probe scan. The point form, the shapecontains-precedence-bug-3473uses, stays acontains?call and bounds nothing.
Potential approach
goal: (contains? (period f t) x) with x a point reaches the join as comparisons over f and t, so the probe scan takes the same bound as for the period form.
-
The point form rewrites to
(and (<= f x) (< x (coalesce t xtdb/end-of-time))).
That istemporal-contains-point?'s own definition (from <= ts < to), so the rewrite changes no result where the types agree. -
check: the rewrite agrees with
contains?for every point typecontains?accepts.
contains?casts atimestamp-localpoint totimestamp-tzin the default time zone, and adatetotimestamp-localfirst (recall-with-cast2);<=/<against atimestamp-tzcolumn cast the other way, to local time. Settle with a test per point type —timestamp-tz,timestamp,date— across a DST overlap, or restrict the rewrite totimestamp-tzpoints. -
The point must be recognisably not a period.
A bare column can be either (the existing test notes "not possible to tell if col1 is a period or a scalar temporal value"), so the rewrite needs the point's type.- assumption: the type is available at emit time and not in the logical plan.
The join's emitter has its children's:vec-types, which is where the valid-time bound already reads the build expression's type; the planner's rules see only symbols. Settle by checking whether any rule inoptimise-plan-ruleshas column types to hand.
- assumption: the type is available at emit time and not in the logical plan.
- Lingua principale
- Clojure
- Stelle
- 3.1k
- Fork
- 193
- Merge medio
- 23h 38m
- PR unite (30g)
- 41
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di xtdb/xtdb
-
metrics
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
documentation pgsource
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
flaky pgsource
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
performance
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
calcit-lang/calcit#2075 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
.Needs Triage .Team/Gadget Priority:P3 Type:Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
metabase/metabase#84431 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
module:db module:terminology-service-local refactoring
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno