Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
I had to optimize a SQL-Query and i was able to cut the amount of time in half.
The business part of the company said it is still too slow, so i researched deeper and looked into the called functions which are used in every part where to claculate value X.
Found 20 similiar selects to get values which are summed up afterwards into three different variables. Thought this can be done in three selects with "sum", but then i found the dumbest thing is this function:
V1, V2 have the values from the selects
V3 is ja given value
X is the return value
the function returns another value
help = functionCall(parameter) - V1 -V2
X= help + V1 + V2 +V3
WTF im mean it does the selects for nothing...
X = functionCall(parameter) + V3
rant