Send a value used several times in one query to the database once
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
Direzione di ricerca
Start by reading the query parameter handling for large values and how it differs across PostgreSQL, MSSQL, and EXTERNAL SQL calls; the issue does not name source files or tests. Trace how repeated uses of one large parameter are represented in a query, then add coverage for the PostgreSQL case and confirm MSSQL and EXTERNAL SQL behavior remains as described. Done means PostgreSQL sends the value once per query while other uses refer to it.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
Some values reach a query as parameters rather than as text written into it: a string longer than 1000 characters or with a quote or a backslash in it, and a file. Such a value - for example the value of a LOCAL property without parameters, used in a query - was sent to the database once for every place where the query uses it. Formulas with IF multiply those places: while the result stays below limitPullCasesComplexity, a formula of N IF operands is built for every combination of their branches (see #1903), so a value used once in each operand appears in the query N * 2^(N-1) times.
big = DATA LOCAL TEXT (); // 800 000 characters
firstChar (TEXT s, INTEGER n) = FORMULA TEXT 'substr($1, $2, 1)';
result() <- GROUP CONCAT (IF mod(INTEGER i, 2) = 0 THEN firstChar(big(), 1) ELSE 'y')
+ (IF mod(i, 3) = 0 THEN firstChar(big(), 2) ELSE 'y')
+ (IF mod(i, 5) = 0 THEN firstChar(big(), 3) ELSE 'y') IF iterate(i, 1, 2400), '' ORDER i;
Here the query uses big() 12 times, so about 10 MB went to the database for one statement. On PostgreSQL such a value now goes once per query, and its other uses refer to it. On MSSQL, and in EXTERNAL SQL calls, every use still sends a value of its own. Only large values are affected noticeably: a copy of a short one costs next to nothing.
Without the change, the copies can be avoided by computing what is needed from the large value into a LOCAL first, as the precomputed variant in #1903 does.
Reason
Found while fixing #1903: with the large value of that issue's example passed as a parameter instead of a literal, its query still carried tens of MB - a copy of the value for every use -, and its first run took long enough to be cancelled by a timeout and run again. With the value sent once, repeated runs of the IF variant of that example went from 236 / 241 ms to 162 / 123 ms.
- Lingua principale
- Java
- Stelle
- 214
- Fork
- 46
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
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 lsfusion/platform
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
Tutte le issue di lsfusion/platform
Issue simili
-
area: cli
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
vitruv-tools/NeoJoin#415 ·
I maintainer di solito rispondono entro 1 giorno
-
Quick Installation step 2 installs from the plugin manager, but the plugin isn't published yetAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
I maintainer di solito rispondono entro 6 giorni
-
account assessment course feature lecture
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] 连接达梦时报错,agent 进程启动即退Apertabug db/dameng user-priority/P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
docs: document identity-provider types compatibility for Keycloak 26.5+Forse già presa @Motouom l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
adorsys/keycloak-config-cli#1766 ·
I maintainer di solito rispondono entro 12 giorni