18F / rdbms-subsetter

Generates a subset of a relational database that respects foreign key constraints
Creative Commons Zero v1.0 Universal
313 stars 30 forks source link

Typo in README.rst #6

Closed twekberg closed 9 years ago

twekberg commented 9 years ago

The main README.rst contains a minor typo in this sentence:

A fraction of 0.5 seems to produce good results, converting 10 rows to 3,
1,000,000 to 1,000,000, and 1,000,000,000 to 31,622.

While converting 10 rows to 3 is good, converting 1,000,000 rows to 1,000,000 isn't much of a reduction. Changing the second 1,000,000 to 1,000 fits with the formula and the other reductions.

An even more minor nit is that math.pow(10, math.log10(n)f) where n=10*9 and f=.5 is 31622.776601683792. Rounding that to an integer is 31,623.

catherinedevlin commented 9 years ago

Good catch, thanks! A utility that reduced 1 million rows to 1 million would confirm all too many stereotypes about government work. :)

As for 1 billion, the program actually finds its target number of rows with int, not round, so it truncates 31622.77 to 31622.

... and, for that matter, foreign key requirements will frequently cause the program to overshoot its target number of rows anyway!