1 00:00:00,060 --> 00:00:07,410 ‫In this video, we will discuss the differences between a server side curser and a client side cursor 2 00:00:07,410 --> 00:00:11,250 ‫with regard to Postgres database and Python. 3 00:00:11,310 --> 00:00:15,150 ‫So here I have a Postgres database in my laptop. 4 00:00:15,450 --> 00:00:16,500 ‫I have a table here. 5 00:00:16,500 --> 00:00:18,900 ‫I create a database and I created a table. 6 00:00:18,910 --> 00:00:19,400 ‫It's empty. 7 00:00:19,410 --> 00:00:22,050 ‫Now, with that said, that's just something in the video. 8 00:00:22,080 --> 00:00:25,920 ‫So what's what is the difference between a server side cursor and a client? 9 00:00:25,920 --> 00:00:26,550 ‫sars-cov-2. 10 00:00:27,090 --> 00:00:34,980 ‫So to to connect to the database from Python, you essentially established something called a cursor, 11 00:00:34,980 --> 00:00:35,220 ‫right? 12 00:00:35,250 --> 00:00:39,520 ‫You create a cursor and then you either write or read from the database. 13 00:00:40,770 --> 00:00:47,010 ‫And the client side cursor is when you, for example, execute a select statement. 14 00:00:47,460 --> 00:00:50,600 ‫Select all from employees like here. 15 00:00:50,970 --> 00:00:59,460 ‫What happens is all the results are executed and delivered over the network to your client, which is 16 00:00:59,460 --> 00:01:12,630 ‫Python and versus the other approach where server side cursors, where a cursor is created on the database. 17 00:01:12,990 --> 00:01:20,190 ‫And only when you absolutely need something the client can say, hey, give me 10 results. 18 00:01:20,190 --> 00:01:23,250 ‫Give me 30, give me whatever, give me one. 19 00:01:23,250 --> 00:01:25,440 ‫Give me the next scroll through the results. 20 00:01:25,650 --> 00:01:30,510 ‫And only when you absolutely need it, it will start fixing this results. 21 00:01:30,510 --> 00:01:38,160 ‫So that result is actually executed on the server and said there and the client kind of fetches them 22 00:01:38,370 --> 00:01:41,130 ‫incrementally or if they wanted all of them. 23 00:01:41,640 --> 00:01:42,740 ‫OK, so that's the difference. 24 00:01:42,900 --> 00:01:44,640 ‫With that said, let's just jump into it. 25 00:01:44,640 --> 00:01:44,810 ‫So.