Red Gate forums :: View topic - Random data issue
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Generator 1
SQL Data Generator 1 forum

Random data issue

Search in SQL Data Generator 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
tkdennis



Joined: 29 Feb 2008
Posts: 75

PostPosted: Tue May 13, 2008 9:06 am    Post subject: Random data issue Reply with quote

I have 2 child tables with Foreign Keys from the same parent table all using the same unique 3-column key. I'm trying to generate different rows in Child1 and Child2, but have not been able to do so.

Parent Rows 600,000 (already generated)
Child Rows 300,000

I have changed the seed values several times, changed the Population method to Repeat Key Values at Random or All Key Values Unique but I still get almost 100% the same keys in the two Child tables when I would expect 50% overlap if it were truly random.

I also tried different row counts and seeds:
Child row counts 100: 6 are duplicates
Child row counts 100, changed seeds: 7 are duplicates
Child row counts 1,000: 561 are duplicates
Child row counts 1,000, changed seeds: 545 are duplicates
Child row counts 10,000: 9496 are duplicates
Child row counts 10,000, changed seeds: 10,000 are duplicates

Am I doing something wrong??

Thanks,
Traci
Back to top
View user's profile Send private message
tkdennis



Joined: 29 Feb 2008
Posts: 75

PostPosted: Tue May 13, 2008 11:16 pm    Post subject: More information Reply with quote

The first 2 columns of the 3-part key are being selected by the Foreign Key generator in numerical order regardless of the Seed or Population method. For example:

Table A (parent table, 600000 rows
Key 1 - randomly numbered 1-999999)
Key 2 - randomly numbered 1-10)
Key 3 - randomly numbered 1-5)

Table B (child table, Foreign Key to Table A on Key1, Key2, Key3)
Trying to generate 100 rows of data for Table B randomly from Table A
Key 1 - Sequentially numbering from Table A.Key1
Key 2 - Sequentially numbering from Table A.Key2
Key 3 - Randomly selecting values from Table A.Key3

The Foreign Key generator is not randomly selecting rows from the 3-part composite key in Table A. It is running through Table A sequentially and deciding at random whether to take the row or not until it reaches the number of rows requested, which in this case is significantly less than the total rows available so only the first part of the Table A is ever processed.

The app won't let me change the Foreign Key Generator on those columns. Is it possible to configure it in some way to get a truly random selection of rows from Table A?

Thanks,
Traci
Back to top
View user's profile Send private message
tkdennis



Joined: 29 Feb 2008
Posts: 75

PostPosted: Tue May 20, 2008 10:31 pm    Post subject: Reply with quote

bump
Back to top
View user's profile Send private message
benhall



Joined: 14 Dec 2007
Posts: 98

PostPosted: Fri May 23, 2008 1:30 pm    Post subject: Reply with quote

Hello,

I'm really sorry for the delay in replying. Been trying to get head around your db structure.

Could you please email me with your DB structure so we can discuss this offline.

Thanks

Ben
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group