‫So in many of my videos, I show how to interact with tables with millions and millions of rows in order
‫to test indexing, partitioning and other other features, especially in my introduction to database.
‫And Janine calls you guys ask me, how do you create a table with such a large quantity of data?
‫So that will be the video to essentially illustrate how to do that.
‫I'm going to do it from scratch.
‫I don't have anything.
‫I'm going to use Docker to spin a proposal because in a sense, create a table, create a million.
‫And that's that very short video.
‫Let's let's get into it, make sure we have Docker and let's write this thing up by postscripts 13.
‫That's the latest version out there.
‫So let's go ahead and do that docker run, because the only thing we need is, is the environment,
‫variable postscripts, password.
‫And we're going to call this all just the password, Bosco's password.
‫And then I'm going to do.
‫Also, Chris, that's exactly the image before we give the image, just give it a name.
‫It's got PG one because they have something called Viju as it.
‫It's as simple as this.
‫Database now we have a database the next day, I don't really need to expose to the poor because I'm
‫going to put it into the container itself and then run that command and I'm going to just open up another
‫terminal and do a docker execute dash interactive terminal and then our container name because big one.
‫And then I want to execute the commands.
‫Esequiel that you the user name is Bockris.
‫And just like that we are now into the postscripts command Schult.
‫The next thing we're going to do is create a table.
‫It's got a temp.
‫As for temperatures and I don't know what are we going to like t valuate integer.
‫I'm going to create it.
‫Assuming this is an Iot populated table with temperatures, I'm going to create a table with just one
‫value to temperatures and we're going to insert a million instances of different temperatures from zero
‫zero to I don't know how to say.
‫That we had the table, so here's the thing, here's how you do the trick we want to insert into temp
‫and that's the value we want to populate.
‫And the trick here is to do a select and from.
‫I'm going to I'm going to leave this as empty here from generate series.
‫And this isn't a built in function and Postgres and that when you do a select from generosities, you
‫can specify from zero to anything really.
‫And I'm, I'm going to do a million in one zero zero zero zero zero zero that will essentially return
‫for you.
‫It varies from zero to a million.
‫Right.
‫And select.
‫But I don't really care about those values because they are very sequential.
‫I want random values.
‫So you're going to call a function called random and random are essentially fractions, right?
‫So zero point zero zero, whatever the values.
‫So I'm going to multiply by 100 to get a value from zero to one hundred.
‫And so since I have an integer, this will be coursed nicely into an integer.
‫So last thing, the semicolon and that's it.
‫If you have indexes, this is going to be that's a really guys.
‫It's done.
‫That's it.
‫So if I know like a select from temp.
‫Limit.
‫Then you can see I have I on our values, and if I select Count Star from Temple.
‫Because I have a million rows, that's it, guys, very, very quick video so you can populate this
‫area and play, you can essentially change that number to be whatever you want, really, and just play
‫with that.
‫And you might say, oh, what if I have multiple fields just easily just add comma and then add that
‫this is obviously an integer, but you can easily do the same thing to create characters with other
‫functions, convert the character, the number into ASCII, into actual characters and play with that.
‫So that's potentially the call.
‫All right, guys, that's it for me today.
‫Very quick video.
‫I'm going to see you in the next one.
‫You guys say goodbye.
‫All the commands, by the way, are going to be in the description so you don't have to pause and look
‫at this stuff.