TonicAI / condenser

Condenser is a database subsetting tool
https://www.tonic.ai
MIT License
312 stars 48 forks source link

Explain desired_result more #8

Closed heatherbooker closed 5 years ago

heatherbooker commented 5 years ago

Hi! I'm a bit confused about what the config property desired_result is supposed to be representing / how I should use it. I see the example.config.json shows

"desired_result": {
    "table": "target_table",
    "schema": "public",
    "percent": 1
},

But any more clarification in the readme would be great to explain which table is meant to be specified, etc. I might guess that percent is the degree to which we want to subset the db?

Thanks!


Search tags: config.json configuration desired end result schema

akamor commented 5 years ago

Hello,

Your guess is correct, the "desired_result" object lets condenser know which table to subset initially and to what percentage. We can potentially add more clarification to the README for this, or if you like you are welcome to open a pull request.

So the example in example.config.jon is telling condenser to keep ~1% of rows in "target_table" then to traverse through the database and remove rows from other tables such that you won't break any foreign key constraints.

Btw, you can read more about how condenser works in our blog (apologies if you've already seen it): https://www.tonic.ai/blog/condenser-a-database-subsetting-tool