Re: [HACKERS] proposal - psql - show longest tables

2013-07-23 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: Even if we thought the functionality was worth the trouble, which I continue to doubt, this particular syntax proposal is a disaster. Agreed. While there might be things worthwhile to add to psql's backslash commands, this isn't one of those.

Re: [HACKERS] proposal - psql - show longest tables

2013-07-22 Thread Robert Haas
On Sun, Jul 21, 2013 at 12:47 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Hello all I very often use a little bit adjusted psql system queries to detection TOP N sized tables. I am thinking so it can be useful for all users I propose a few new commands \dts [N|size] ... show N

Re: [HACKERS] proposal - psql - show longest tables

2013-07-22 Thread Pavel Stehule
2013/7/22 Robert Haas robertmh...@gmail.com: On Sun, Jul 21, 2013 at 12:47 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Hello all I very often use a little bit adjusted psql system queries to detection TOP N sized tables. I am thinking so it can be useful for all users I propose a

Re: [HACKERS] proposal - psql - show longest tables

2013-07-22 Thread Merlin Moncure
On Mon, Jul 22, 2013 at 2:03 PM, Robert Haas robertmh...@gmail.com wrote: On Sun, Jul 21, 2013 at 12:47 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Hello all I very often use a little bit adjusted psql system queries to detection TOP N sized tables. I am thinking so it can be useful

Re: [HACKERS] proposal - psql - show longest tables

2013-07-22 Thread Robert Haas
On Mon, Jul 22, 2013 at 3:13 PM, Merlin Moncure mmonc...@gmail.com wrote: On Mon, Jul 22, 2013 at 2:03 PM, Robert Haas robertmh...@gmail.com wrote: On Sun, Jul 21, 2013 at 12:47 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Hello all I very often use a little bit adjusted psql system

Re: [HACKERS] proposal - psql - show longest tables

2013-07-22 Thread Pavel Stehule
2013/7/22 Merlin Moncure mmonc...@gmail.com: On Mon, Jul 22, 2013 at 2:03 PM, Robert Haas robertmh...@gmail.com wrote: On Sun, Jul 21, 2013 at 12:47 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Hello all I very often use a little bit adjusted psql system queries to detection TOP N

Re: [HACKERS] proposal - psql - show longest tables

2013-07-22 Thread Andrew Dunstan
On 07/22/2013 03:11 PM, Pavel Stehule wrote: 2013/7/22 Robert Haas robertmh...@gmail.com: Rather than just continuing to add more imposible-to-remember syntax, we really need a better design here. do you have any tip? I agree with Robert. My tip is this: when you're in a hole, the first

Re: [HACKERS] proposal - psql - show longest tables

2013-07-22 Thread Jeff Janes
On Mon, Jul 22, 2013 at 12:40 PM, Andrew Dunstan and...@dunslane.net wrote: On 07/22/2013 03:11 PM, Pavel Stehule wrote: 2013/7/22 Robert Haas robertmh...@gmail.com: Rather than just continuing to add more imposible-to-remember syntax, we really need a better design here. do you have any

Re: [HACKERS] proposal - psql - show longest tables

2013-07-22 Thread Dimitri Fontaine
Pavel Stehule pavel.steh...@gmail.com writes: SELECT * from top5(); $ TABLE top5; -- add a view on top of the SRF you cannot use parameters - then I have to have prepared files like top10, top20, ... what is not too friendly The SRF could be using custom GUCs so that you can parametrize

Re: [HACKERS] proposal - psql - show longest tables

2013-07-22 Thread David Fetter
On Mon, Jul 22, 2013 at 02:44:59PM -0700, Dimitri Fontaine wrote: Pavel Stehule pavel.steh...@gmail.com writes: SELECT * from top5(); $ TABLE top5; -- add a view on top of the SRF you cannot use parameters - then I have to have prepared files like top10, top20, ... what is not too

Re: [HACKERS] proposal - psql - show longest tables

2013-07-22 Thread David Fetter
On Mon, Jul 22, 2013 at 03:55:33PM -0700, David Fetter wrote: On Mon, Jul 22, 2013 at 02:44:59PM -0700, Dimitri Fontaine wrote: Pavel Stehule pavel.steh...@gmail.com writes: SELECT * from top5(); $ TABLE top5; -- add a view on top of the SRF you cannot use parameters - then I

Re: [HACKERS] proposal - psql - show longest tables

2013-07-22 Thread Tom Lane
Jeff Janes jeff.ja...@gmail.com writes: Is looking for the biggest tables a common enough thing that it should be available to everyone, without needing custom customization? I don't really think so. It's surely not much harder than select relname, pg_relation_size(oid) from pg_class

Re: [HACKERS] proposal - psql - show longest tables

2013-07-22 Thread Andrew Dunstan
On 07/22/2013 04:26 PM, Jeff Janes wrote: On Mon, Jul 22, 2013 at 12:40 PM, Andrew Dunstan and...@dunslane.net wrote: On 07/22/2013 03:11 PM, Pavel Stehule wrote: 2013/7/22 Robert Haas robertmh...@gmail.com: Rather than just continuing to add more imposible-to-remember syntax, we really

Re: [HACKERS] proposal - psql - show longest tables

2013-07-22 Thread Pavel Stehule
I agree with Robert. My tip is this: when you're in a hole, the first thing to do is to stop digging. I don't think that Pavel believes himself to be in a hole. After setting up my .psqlrc file as I normally do, I could do this: :rtsize limit 10; But it doesn't have the 'MB' feature, and

Re: [HACKERS] proposal - psql - show longest tables

2013-07-22 Thread Pavel Stehule
2013/7/23 Tom Lane t...@sss.pgh.pa.us: Jeff Janes jeff.ja...@gmail.com writes: Is looking for the biggest tables a common enough thing that it should be available to everyone, without needing custom customization? I don't really think so. It's surely not much harder than select

Re: [HACKERS] proposal - psql - show longest tables

2013-07-22 Thread Pavel Stehule
2013/7/22 Dimitri Fontaine dimi...@2ndquadrant.fr: Pavel Stehule pavel.steh...@gmail.com writes: SELECT * from top5(); $ TABLE top5; -- add a view on top of the SRF you cannot use parameters - then I have to have prepared files like top10, top20, ... what is not too friendly The SRF

Re: [HACKERS] proposal - psql - show longest tables

2013-07-22 Thread Pavel Stehule
2013/7/23 Pavel Stehule pavel.steh...@gmail.com: 2013/7/22 Dimitri Fontaine dimi...@2ndquadrant.fr: Pavel Stehule pavel.steh...@gmail.com writes: SELECT * from top5(); $ TABLE top5; -- add a view on top of the SRF you cannot use parameters - then I have to have prepared files like

Re: [HACKERS] proposal - psql - show longest tables

2013-07-22 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Sun, Jul 21, 2013 at 12:47 AM, Pavel Stehule pavel.steh...@gmail.com wrote: I propose a few new commands \dts [N|size] ... show N largest tables | show tables larger than size ordered by size \dis [N|size] ... show N largest indexes | show

Re: [HACKERS] proposal - psql - show longest tables

2013-07-22 Thread Pavel Stehule
2013/7/23 Tom Lane t...@sss.pgh.pa.us: Robert Haas robertmh...@gmail.com writes: On Sun, Jul 21, 2013 at 12:47 AM, Pavel Stehule pavel.steh...@gmail.com wrote: I propose a few new commands \dts [N|size] ... show N largest tables | show tables larger than size ordered by size \dis [N|size]