From: | Steve Crawford <scrawford(at)pinpointresearch(dot)com> |
---|---|
To: | sachin kotwal <kotsachin(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: filling database |
Date: | 2013-08-26 18:18:11 |
Message-ID: | 521B9BE3.9000609@pinpointresearch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 08/23/2013 03:29 AM, sachin kotwal wrote:
> create sample table with one or two rows then use following command to
> populate data.
>
> INSERT INTO TABLE_NAME VALUES(generate_series(1,1000000000));
>
Cartesian joins are also useful - especially when you want
semi-realistic data. A quick Google will get you a list of 1000 surnames
and another 1000 given names. Then a cartesian join like:
select given.givenname, surnames.surname from given,surnames
will give you a million rows. Add a middle-initial column and you
quickly expand to 26-million unique names. Need more? There are lists
that go well beyond 1000 names or you can just use a full middle name
instead of an initial and get a 1,000,000,000 names (or somewhat less if
you eliminate names where first/middle/last name are the same).
Then you can chuckle at your newly integrated society with Huang
Alexopoulos O'Leary, Albrecht Fernandez Grebenshchikov and Wekesa
Étienne Nikoleta.
Add in similar lists of common town-names and street-names along with
some generated street numbers and you will quickly exceed the world
population and/or your storage capacity.
Cheers,
Steve
From | Date | Subject | |
---|---|---|---|
Next Message | Jeff Janes | 2013-08-26 18:41:02 | Re: Problem creating index |
Previous Message | Rafael Martinez Guerrero | 2013-08-26 17:50:28 | Re: Problem creating index |