refactor: refs #5586 Optimized SQL negativeBases #2007

Merged
guillermo merged 12 commits from 5586-optimizeNegativeBases into dev 2024-02-20 06:28:05 +00:00
1 changed files with 1 additions and 1 deletions
Showing only changes of commit 5a0ce700b3 - Show all commits

View File

@ -87,7 +87,7 @@ module.exports = Self => {
WHERE t.shipped BETWEEN ? AND util.dayEnd(?)
guillermo marked this conversation as resolved
Review

posar una funcio en el where pot fer que no puga indexar, revisa be que vaja rapid

posar una funcio en el where pot fer que no puga indexar, revisa be que vaja rapid
Review

Funciona mes rapid que antes.

Funciona mes rapid que antes.
AND t.refFk IS NULL
AND c.typeFk IN ('normal','trust')
GROUP BY t.clientFk, t.totalWithoutVat
GROUP BY t.clientFk, negativeBase.taxableBase
guillermo marked this conversation as resolved Outdated

un ticket que tinga 2 bases imponibles ha de tindre dos linies, amb este group by ho fusiona en una..

un ticket que tinga 2 bases imponibles ha de tindre dos linies, amb este group by ho fusiona en una..
HAVING amount < 0`, [args.from, args.to]));
stmt = new ParameterizedSQL(`SELECT * FROM tmp.filter`);