‫All right, guys, so now that we have a million rows, what are we going to do is insert a new file
‫here and then I'm going to call it server cursor.
‫Server side, curser, the pie, and then I'm going to create another file called Client Server, so
‫I started with the client.
‫How do we do a client curser that actually what are we going to do is query all the rows and then just
‫measure the time for the query to get executed.
‫Then we're going to fetch the first 50 rows.
‫OK, so that's that's what that's our criteria.
‫And we're going to do it first with their client cursor and then we're going to do it with the server
‫cursor again and budget cycle and then connection equal.
‫Well, let's deal.
‫Right, guys.
‫Just saving some time here, OK?
‫I have a connection.
‫Connection with close.
‫OK, let's do a cursor that is client Cycloset.
‫So of course our core connection to the cursor.
‫If you don't specify any parameter here, you get a client side cursor, client side cursor and we explain
‫the one.
‫Is that right?
‫And then when we want to do as cursor dot execute, select all from employees, obviously this is a
‫huge bad mistake to do that.
‫Right.
‫But we're doing some performance thing anyway, right.
‫So even with a workload, sometimes it gets quick and gets slow.
‫Right.
‫But that essentially will execute everything.
‫And then what?
‫We will return or return a bunch of arrows for us?
‫No, that will not return any rules, actually.
‫Again, so Curser does fetch many will actually return the number of rows.
‫And I want just 50 euros, OK?
‫And I'm not going to print them or anything.
‫OK, so now we need to actually measure the time to do that, OK?
‫And to do that, we're going to need Fordism Library time.
‫All right.
‫I just like use a TI so we can do it simply and then let's do that starts time.
‫OK, equal t the time.
‫Make a snapshot before we start the cursor and after we start the cursor we will get the time divided
‫subtracted from the start time.
‫Right.
‫And that will be in seconds essentially.
‫Right.
‫So I want it in milliseconds.
‫So I'm that's multiplied by a thousand again.
‫All right.
‫So now we have and we're going to print F cursor established in e millisecond cool.
‫And then we're going to do the same exact thing for the execute.
‫Cool, and then we're going to do but this is different now because I established on the established
‫query all rows, I would say this Caldas executes the query.
‫All right.
‫And then this is different.
‫This is actually pitching this thing.
‫OK, and we're going to explain how is this different?
‫OK, execute the query.
‫And this is actually fetching 50 arrows.
‫First, if you just fetch the first draw and tell me how long it takes.
‫OK, how about we run and see how this is going on?
‫Oh, I forgot to cross the cursor guys because of the clues.
‫OK.
‫And then a start.
‫All right, so let's zoom in here so you guys can read this.
‫Establishing the cursor obviously doesn't take anything is just literally declaring that statement right
‫or point zero to millisecond, but look at executing the query, which is we didn't have to actually
‫get the result was just executing the query for every single thing.
‫And do the cursor took eight hundred forty five milliseconds and then fetching the first first if there
‫was nothing.
‫Right, almost nothing because we have everything in the client.
‫Right.
‫We now if I look at the processes like the processes you just taking containing one million tuple row,
‫OK, and obviously the more you execute it's a tuple, so it's not an array.
‫So we didn't actually allocate everything.
‫So it's slightly different.
‫It's a read-only.