1 00:00:00,060 --> 00:00:07,650 ‫To do that, we need actually a large table and to do a large table, we need to actually populated 2 00:00:07,650 --> 00:00:10,060 ‫with, I don't know, like a million rows. 3 00:00:10,080 --> 00:00:11,980 ‫OK, so let's go ahead and do that, OK? 4 00:00:12,420 --> 00:00:16,890 ‫And I'm going to speed up through this process, maybe through the video. 5 00:00:16,890 --> 00:00:19,680 ‫But essentially what we're going to do is create a new project. 6 00:00:20,370 --> 00:00:24,410 ‫And this is called server versus client courser. 7 00:00:24,600 --> 00:00:24,950 ‫Right. 8 00:00:25,230 --> 00:00:34,230 ‫So new projects are going to go ahead and then go ahead and create a file here called insert one million 9 00:00:34,500 --> 00:00:35,310 ‫pie. 10 00:00:35,460 --> 00:00:43,680 ‫And that's the file that we will use to essentially create a lot of rows in this table. 11 00:00:43,800 --> 00:00:44,100 ‫OK. 12 00:00:44,280 --> 00:00:44,570 ‫All right. 13 00:00:44,580 --> 00:00:48,960 ‫So the first thing we need to do is in part be Syco two. 14 00:00:49,620 --> 00:00:53,490 ‫And then I want to have obviously establish a connection. 15 00:00:53,490 --> 00:00:53,860 ‫Right. 16 00:00:53,880 --> 00:00:56,390 ‫So that is how you do a connection. 17 00:00:57,540 --> 00:00:58,470 ‫What's your host? 18 00:00:58,470 --> 00:01:00,400 ‫My machine name is called Hosain Mac. 19 00:01:00,420 --> 00:01:02,520 ‫That's where my postcrisis instance is. 20 00:01:03,030 --> 00:01:11,730 ‫Database equals Hussein DB and obviously the user is postscripts. 21 00:01:12,060 --> 00:01:19,290 ‫The password is Postgres and the port is five, four, three, two, which is the default port. 22 00:01:19,300 --> 00:01:19,530 ‫Right. 23 00:01:19,740 --> 00:01:24,330 ‫So obviously you have to close the connection, make it a habit. 24 00:01:24,480 --> 00:01:28,190 ‫OK, and then what we need to do is essentially create a cursor. 25 00:01:28,230 --> 00:01:28,590 ‫Right. 26 00:01:28,910 --> 00:01:36,490 ‫And to create a cursor, you ask the connection, give me a cursor then what do you do? 27 00:01:36,630 --> 00:01:41,370 ‫As for I in range does a million. 28 00:01:41,530 --> 00:01:42,680 ‫I think that's a million. 29 00:01:42,690 --> 00:01:43,150 ‫Right. 30 00:01:44,010 --> 00:01:46,140 ‫Go ahead and execute millions or statements. 31 00:01:46,150 --> 00:01:47,070 ‫That's the easiest way. 32 00:01:47,070 --> 00:01:47,280 ‫Right. 33 00:01:47,310 --> 00:01:53,020 ‫Obviously there is like a most optimal ways of doing things, but we're just inserting here. 34 00:01:53,070 --> 00:01:59,670 ‫Obviously I'm going to skip through this and I'm not going to wait for all the million stuff to get 35 00:01:59,670 --> 00:02:00,270 ‫inserted. 36 00:02:01,170 --> 00:02:06,030 ‫OK, is this right, I.D.? 37 00:02:06,030 --> 00:02:14,040 ‫And then obviously I want I and I don't know the employee's name or test. 38 00:02:14,040 --> 00:02:16,580 ‫I think that's a great name. 39 00:02:17,130 --> 00:02:18,450 ‫It's a beautiful name. 40 00:02:18,510 --> 00:02:22,710 ‫OK, and then obviously, once you're done, you have to do a connection that out. 41 00:02:23,290 --> 00:02:26,520 ‫And the reason is you want to commit your changes. 42 00:02:27,240 --> 00:02:31,170 ‫You don't want to create a million rows and then say that you closed. 43 00:02:32,010 --> 00:02:33,250 ‫The whole thing will be rolled back. 44 00:02:33,270 --> 00:02:33,680 ‫All right. 45 00:02:33,720 --> 00:02:36,960 ‫So let's go ahead and run this guy's. 46 00:02:38,830 --> 00:02:43,530 ‫And what happened, I think we got to give it an error here. 47 00:02:45,130 --> 00:02:56,860 ‫I know, looks good was going on, it's going okay to 51, go ahead to 50 to nice. 48 00:03:01,520 --> 00:03:10,380 ‫All right, this is chugging, let us chug and whenever it's ready, guys, I will come back. 49 00:03:10,400 --> 00:03:21,290 ‫All right, guys, we have a million euros, I think so let's make sure that this is true. 50 00:03:22,190 --> 00:03:23,280 ‫Oh, that's wrong. 51 00:03:23,540 --> 00:03:26,680 ‫OK, that's the Canstar. 52 00:03:27,560 --> 00:03:28,100 ‫Yep. 53 00:03:28,100 --> 00:03:29,510 ‫We have a million euros.