Cull database
Many times in working with and developing a large site you need quite a few things set up (settings, options, etc) exactly how it is on production, however you don't necessarily need EVERY single record, post, post meta and media all cluttering up your local machine.
I think the ability to cull the database of everything except a handful of posts would be fantastic.
i.e.
wp db cull --post-type=posts --preserve=100
Or something to that effect.
This would be an interesting problem to solve.
I think the biggest challenge is to do this quickly/efficiently without having to comb through every single post/post-meta row.
I.e. something akin to mysql's truncate. BUT how do we do that AND still preserve SOME items?
Thinking out loud, what if we copied over the items we wished to preserve to a tmp table/in memory and then truncated the post/postmeta tables, then copied the preserved items back?
I'm sure there would be issues, but again, just thinking outside the box.
Needs clarification: are we looking for a tool to quickly drop everything except a group of chosen data, or a random group of data?
Dropping all but the 10 latest posts, or the 10 earliest posts, or any 10 random posts, is an easy database query. Doing it for 10 specific posts would require identifying the posts, and by then, the work is done; automation provides little after that point.
Marked this as state:considering. I think it's an interesting idea but there are a fair number of conceptual questions to work through (e.g. "what gets deleted?")