~60% drop in JSONBench q3 query perf at commit 90d33e1

Chiusa
#7,484 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
Più di una settimana
Idoneità per principianti
18/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, json
Ambito
performance

Direzione di ricerca

The regression is tied to the merge of #7450, so start by reading that diff and the query path it changed, then reproduce the timing with the super command in the issue against a bluesky1m.bsup file. The reporter's Gist records a trade-off analysis, so read it before proposing anything. Done would mean the JSONBench q3 query recovers most of its earlier speed without losing the gains #7450 was meant to deliver.

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

Descrizione

The performance of the JSONBench q3 query dropped significantly at commit 90d33e1 (associated with the merge of #7450). Other JSONBench queries saw lesser impact (<10%).

At commit fef98bc just prior to the merge of #7450, the query runs for 0.256s:

$ curl -sO https://clickhouse-public-datasets.s3.amazonaws.com/bluesky/file_0001.json.gz &&
  super -version &&
  super -dynamic -i json -f bsup -o bluesky1m.bsup file_0001.json.gz &&
  time super -s -c "
SELECT
    commit.collection AS event,
    EXTRACT(HOUR FROM time_us*1000::time) as hour_of_day,
    count() AS count
FROM 'bluesky1m.bsup'
WHERE kind = 'commit'
  AND commit.operation = 'create'
  AND commit.collection in ['app.bsky.feed.post', 'app.bsky.feed.repost', 'app.bsky.feed.like']
GROUP BY event, hour_of_day
ORDER BY hour_of_day, event;"

Version: v0.3.0-498-gfef98bcc3

{event:"app.bsky.feed.like",hour_of_day:16,count:444523}
{event:"app.bsky.feed.post",hour_of_day:16,count:86812}
{event:"app.bsky.feed.repost",hour_of_day:16,count:56993}

real	0m0.256s
user	0m1.540s
sys	0m0.131s

At commit 90d33e1 when #7450 merged, the query runs for 0.411s:

$ super -version &&
  super -dynamic -i json -f bsup -o bluesky1m.bsup file_0001.json.gz &&
  time super -s -c "
SELECT
    commit.collection AS event,
    EXTRACT(HOUR FROM time_us*1000::time) as hour_of_day,
    count() AS count
FROM 'bluesky1m.bsup'
WHERE kind = 'commit'
  AND commit.operation = 'create'
  AND commit.collection in ['app.bsky.feed.post', 'app.bsky.feed.repost', 'app.bsky.feed.like']
GROUP BY event, hour_of_day
ORDER BY hour_of_day, event;"

Version: v0.3.0-499-g90d33e1c7

{event:"app.bsky.feed.like",hour_of_day:16,count:444523}
{event:"app.bsky.feed.post",hour_of_day:16,count:86812}
{event:"app.bsky.feed.repost",hour_of_day:16,count:56993}

real	0m0.411s
user	0m3.011s
sys	0m0.219s

Details

Repro is at super commit 90d33e1, which is associated with the merge of #7450 (and the problem remains at current tip of main, commit 08d2f08).

Claude's take is available in a Gist. The tl;dr is that this could be seen as a trade-off, as it was able to craft queries that saw significant improvements from the change in #7450. It just happens to be the case that none of the JSONBench queries are like that and for them it's an overall net loss. Therefore its analysis and patch revolve around whether it's possible to still deliver benefits intended in #7450 where appropriate while lessening the perf hit on queries like these JSONBench ones.

Lingua principale
Go
Stelle
1.6k
Fork
84
Merge medio
9h 55m
PR unite (30g)
144

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 superdb/super

Tutte le issue di superdb/super

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.