Re: [PATCHES] selecting large result sets in psql using

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, Peter Eisentraut <peter_e(at)gmx(dot)net>, Chris Mair <chrisnospam(at)1006(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: [PATCHES] selecting large result sets in psql using
Date: 2006-08-24 09:19:21
Message-ID: 20060824091921.GC73562@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Fri, Aug 18, 2006 at 10:16:12AM -0400, Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > A \set variable would make sense to me.
>
> So Peter and Bruce like a \set variable, Chris and I like a different
> command. Seems like a tie ... more votes out there anywhere?

If this will be used interactively, it would be nice to have both. That
way if you're running a bunch of cursor fetches, you can just do one
\set, but if you only want to run one or a few you can use \gc and not
mess around with \set. But I don't know how common interactive usage
will be. Presumably code can easily be taught to do either, though \set
would probably be less invasive to older code that someone wants to
change.

Another thought (which probably applies more to \set than \gc): if you
could set a threshold of how many rows the planner is estimating before
automatically switching to a cursor, that would simplify things.
Interactively, you could just let psql/PostgreSQL decide which was best
for each query. Same is true in code, though it probably matters more
for existing code than new code.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2006-08-24 09:41:37 Re: Tricky bugs in concurrent index build
Previous Message Markus Schiltknecht 2006-08-24 09:18:35 Re: Replication

Browse pgsql-patches by date

  From Date Subject
Next Message Zoltan Boszormenyi 2006-08-24 09:53:31 Re: [HACKERS] COPY view
Previous Message Dhanaraj M 2006-08-24 06:31:50 Re: [PATCHES] Patch - Have psql show current values