-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
select rows based on simple criteria #8
Comments
I could see that. What do you think the command syntax should look like for that? |
I'm currently using: I guess something like:
or
should be easy to parse and is extensible in case other criteria is added. |
You should be able to specify a where condition after the =. e.g., --limit="users=(user_id < 10)" |
@mla Had a similar question like this, is it possible to select EVERY table in DESC order? I think all (most?) tables in rails for example have "created_at", so it'd be nice to sample rows with |
Hey @lustickd. Sorry for the delay in responding. You can try this patch, which should just force that ORDER BY for every table.
We'd have to look at how we can express that for general use. Rails doesn't automatically create an index on all created_at columns, does it? That would be my worry, if you have really large tables. |
You might try this:
And pass the --ordered option. We order by the first candidate key we find. Rails usually has its "id" column, which should roughly match created_at, I would think. Patch above just adds DESC to those columns. Seems like a reasonable default anyway for that option. |
Ah that makes sense thanks. Yeah I think I did mess around a little bit with tsm_system_rows for random sampling and it's significantly faster than using |
Would it be possible to select rows based in very simple criteria?
I mean, I have a database with a very large table and I would like to
select all rows for all tables except
data
table where I want 1000000 rows ORDER by timestamp DESC;Thanks for the library.
The text was updated successfully, but these errors were encountered: