3 ms·
You mean, run the (possibly expensive) query twice with different sort orders, and not see the middle ones at all? If that is what you mean, I think the advant
by philh 11y ago
You mean, run the (possibly expensive) query twice with different sort orders, and not see the middle ones at all?
If that is what you mean, I think the advantage remains with PMA.
Edit to clarify: I'm thinking here in terms of data exploration. I want to look at the whole result set, but the most interesting ones are likely to be at the top and bottom. With PMA, I can get the whole result set, and nothing else, on a single page. So I just scroll to the top or bottom of the page to see the extreme values.
With a CLI, it can be difficult to find where the output of that specific query started. (This is a trade-off, because the CLI allows you to see results from your previous queries.)
If there was a CLI feature like 'view the previous result set in less, without re-running it', I think that would satisfy me on this point. If you have to re-run it, that's less good, but it would beat scrolling.
- moonchrome 11y agoI'm not a DB/pg guy but I think you want SELECT INTO TEMP which will create a temp table from your query (gets dropped at the end of the session).
- DrJokepu 11y agoCommon Table Expressions: http://www.postgresql.org/docs/9.4/static/queries-with.html http://www.postgresql.org/docs/9.4/static/queries-with.html
- kirubakaran 11y agoIf a default pager isn't set for you, you could set it. http://stackoverflow.com/questions/14474138/customize-pager-in-psql http://stackoverflow.com/questions/14474138/customize-pager-...
- philh 11y agoThank you! This is a pretty good solution, and it turns out it exists in mysql too. (`pager less`)
- dragonwriter 11y ago> You mean, run the (possibly expensive) query twice with different sort orders, and not see the middle ones at all? Or run it once into a temporary table, and then query the temporary table however you want to get subsets of interest. Which, if you are doing data exploration on the potentially large results of a potentially expensive query, is probably what you should be doing, no matter what tool you are using. Because it lets you do a lot more than just check the top and bottom easily.
- deleted 11y ago[deleted]