Thread: [GENERAL] Indexes and loops or some kind of pg error?

[GENERAL] Indexes and loops or some kind of pg error?

From
Арсен Арутюнян
Date:
Hello.
I have a few questions:
1)  JobStatusTest1 function has only one request and JobStatusTest2 function has as many as six requests.
Why function JobStatusTest2 is faster? 

JobStatusTest1 : 981.596 ms
JobStatusTest2 : 849.133 ms

2) Two functions JobStatusTest3 and JobStatusTest4 perform the same actions. But one of the function performs the same steps in the cycle.
Why is the speed of the functions so incredibly much different?

JobStatusTest3 : 1430.777 ms
JobStatusTest4 : 2.386 ms

best
Arsen Arutyunyan
Attachment