Re: [HACKERS] pgbench \for or similar loop

2011-04-23 Thread Dimitri Fontaine
Greg Smith writes: > Kevin Grittner wrote: >> I'm not clear on exactly what you're proposing there, but the thing >> I've considered doing is having threads to try to keep a FIFO queue >> populated with a configurable transaction mix, while a configurable >> number of worker threads pull those tra

Re: [HACKERS] pgbench \for or similar loop

2011-04-22 Thread Pavel Stehule
Hello > > This isn't very well known because the whole MySQL community fracturing has > impacted their ability to actually release this overhaul--seems like they > spend all their time just trying to add support for each new engine of the > month.  I don't even like Lua, yet this still seems like

Re: [HACKERS] pgbench \for or similar loop

2011-04-21 Thread Greg Smith
Kevin Grittner wrote: I'm not clear on exactly what you're proposing there, but the thing I've considered doing is having threads to try to keep a FIFO queue populated with a configurable transaction mix, while a configurable number of worker threads pull those transactions off the queue and...

Re: [HACKERS] pgbench \for or similar loop

2011-04-21 Thread Greg Smith
Alvaro Herrera wrote: Why do we have pgbench at all in the first place? Surely we could rewrite it in plpgsql with proper stored procedures. pgbench gives you a driver program with the following useful properties: 1) Multiple processes are spawned and each gets its own connection 2) A time

Re: [HACKERS] pgbench \for or similar loop

2011-04-20 Thread Robert Haas
On Wed, Apr 20, 2011 at 2:23 PM, David Fetter wrote: > On Wed, Apr 20, 2011 at 02:12:25PM -0400, Robert Haas wrote: >> On Wed, Apr 20, 2011 at 2:10 PM, David Fetter wrote: >> > It is precisely this kind of issue that leads me to believe it would >> > be counter-productive to come up with any clie

Re: [HACKERS] pgbench \for or similar loop

2011-04-20 Thread David Fetter
On Wed, Apr 20, 2011 at 02:12:25PM -0400, Robert Haas wrote: > On Wed, Apr 20, 2011 at 2:10 PM, David Fetter wrote: > > It is precisely this kind of issue that leads me to believe it would > > be counter-productive to come up with any client-specific hacks. > > These definitional issues exist on

Re: [HACKERS] pgbench \for or similar loop

2011-04-20 Thread Robert Haas
On Wed, Apr 20, 2011 at 2:10 PM, David Fetter wrote: > It is precisely this kind of issue that leads me to believe it would > be counter-productive to come up with any client-specific hacks. These definitional issues exist on the server, too, and weren't considered early enough there either. Pre

Re: [HACKERS] pgbench \for or similar loop

2011-04-20 Thread David Fetter
On Wed, Apr 20, 2011 at 01:35:03PM -0400, Robert Haas wrote: > On Wed, Apr 20, 2011 at 10:46 AM, Merlin Moncure wrote: > > On Wed, Apr 20, 2011 at 9:14 AM, Alvaro Herrera > > wrote: > >> Excerpts from David Fetter's message of mié abr 20 10:54:56 -0300 2011: > >>> On Wed, Apr 20, 2011 at 08:05:07

Re: [HACKERS] pgbench \for or similar loop

2011-04-20 Thread Robert Haas
On Wed, Apr 20, 2011 at 10:46 AM, Merlin Moncure wrote: > On Wed, Apr 20, 2011 at 9:14 AM, Alvaro Herrera > wrote: >> Excerpts from David Fetter's message of mié abr 20 10:54:56 -0300 2011: >>> On Wed, Apr 20, 2011 at 08:05:07AM +0200, Pavel Stehule wrote: >>> > Hello >>> > >>> > I played with ps

Re: [HACKERS] pgbench \for or similar loop

2011-04-20 Thread David Fetter
On Wed, Apr 20, 2011 at 04:00:12PM +0200, Pavel Stehule wrote: > 2011/4/20 David Fetter : > > On Wed, Apr 20, 2011 at 08:05:07AM +0200, Pavel Stehule wrote: > >> Hello > >> > >> I played with psql extensions two years ago - it can do it > > > > It's interesting, but it doesn't solve the fundamental

Re: [HACKERS] pgbench \for or similar loop

2011-04-20 Thread Merlin Moncure
On Wed, Apr 20, 2011 at 9:14 AM, Alvaro Herrera wrote: > Excerpts from David Fetter's message of mié abr 20 10:54:56 -0300 2011: >> On Wed, Apr 20, 2011 at 08:05:07AM +0200, Pavel Stehule wrote: >> > Hello >> > >> > I played with psql extensions two years ago - it can do it >> >> It's interesting,

Re: [HACKERS] pgbench \for or similar loop

2011-04-20 Thread Alvaro Herrera
Excerpts from David Fetter's message of mié abr 20 10:54:56 -0300 2011: > On Wed, Apr 20, 2011 at 08:05:07AM +0200, Pavel Stehule wrote: > > Hello > > > > I played with psql extensions two years ago - it can do it > > It's interesting, but it doesn't solve the fundamental problem, which > is to a

Re: [HACKERS] pgbench \for or similar loop

2011-04-20 Thread Pavel Stehule
2011/4/20 David Fetter : > On Wed, Apr 20, 2011 at 08:05:07AM +0200, Pavel Stehule wrote: >> Hello >> >> I played with psql extensions two years ago - it can do it > > It's interesting, but it doesn't solve the fundamental problem, which > is to allow every client, not just psql, to do this. then

Re: [HACKERS] pgbench \for or similar loop

2011-04-20 Thread David Fetter
On Wed, Apr 20, 2011 at 08:05:07AM +0200, Pavel Stehule wrote: > Hello > > I played with psql extensions two years ago - it can do it It's interesting, but it doesn't solve the fundamental problem, which is to allow every client, not just psql, to do this. Cheers, David. -- David Fetter http:/

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Pavel Stehule
Hello I played with psql extensions two years ago - it can do it http://okbob.blogspot.com/2009/03/experimental-psql.html The source code is available on pgfoundry Regards Pavel Stehule 2011/4/19 David Fetter : > On Mon, Apr 18, 2011 at 06:02:53PM -0300, Alvaro Herrera wrote: >> Hi, >> >> Tod

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Jeff Janes
On Tue, Apr 19, 2011 at 11:22 AM, Alvaro Herrera wrote: > Excerpts from Tom Lane's message of mar abr 19 14:22:54 -0300 2011: >> Alvaro Herrera writes: >> > Excerpts from Robert Haas's message of mar abr 19 13:33:27 -0300 2011: >> >> Well, I'm all good with that, too, but am not fired up about ei

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Alvaro Herrera
Excerpts from Tom Lane's message of mar abr 19 14:22:54 -0300 2011: > Alvaro Herrera writes: > > Excerpts from Robert Haas's message of mar abr 19 13:33:27 -0300 2011: > >> Well, I'm all good with that, too, but am not fired up about either > >> one to implement it myself. So I think it's going t

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Aidan Van Dyk
On Tue, Apr 19, 2011 at 1:57 PM, Kevin Grittner wrote: > Aidan Van Dyk wrote: > >> And for the "first-hack-that-comes-to-mind", I find my self >> pulling out the named fifo trick all the time, and just leaving my >> for/loop/if logic  in bash writing SQL commands to the fifo, >> occasionally gett

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Kevin Grittner
Aidan Van Dyk wrote: > And for the "first-hack-that-comes-to-mind", I find my self > pulling out the named fifo trick all the time, and just leaving my > for/loop/if logic in bash writing SQL commands to the fifo, > occasionally getting psql to write an answer to a file that I then > read back

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread David Fetter
On Tue, Apr 19, 2011 at 12:27:45PM -0400, Christopher Browne wrote: > On Tue, Apr 19, 2011 at 12:22 PM, Robert Haas wrote: > > Yeah.  I was wondering if anyone was gung-ho enough about this to > > implement some kind of library that both programs could draw on. > > > > It probably wouldn't be supe

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Aidan Van Dyk
On Tue, Apr 19, 2011 at 1:22 PM, Tom Lane wrote: > I think what that really translates to is "I don't want to bother doing > the careful design work that Robert talked about". -1 for that approach. As someone not doing any of that work, agreed ;-) > I generally feel that such a feature would be

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Andres Freund
On Tuesday, April 19, 2011 07:22:54 PM Tom Lane wrote: > I generally feel that such a feature would be better off done > server-side --- after all, there's more clients in the world than psql > and pgbench, and not all of them could use a C library even if we had > one. But in either case the codi

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Tom Lane
Alvaro Herrera writes: > Excerpts from Robert Haas's message of mar abr 19 13:33:27 -0300 2011: >> Well, I'm all good with that, too, but am not fired up about either >> one to implement it myself. So I think it's going to come down to >> what the person doing the work feels most strongly about.

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Merlin Moncure
On Tue, Apr 19, 2011 at 11:49 AM, Alvaro Herrera wrote: > Excerpts from Robert Haas's message of mar abr 19 13:33:27 -0300 2011: >> On Tue, Apr 19, 2011 at 12:27 PM, Christopher Browne >> wrote: >> > On Tue, Apr 19, 2011 at 12:22 PM, Robert Haas >> > wrote: >> >> Yeah.  I was wondering if anyo

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Alvaro Herrera
Excerpts from Robert Haas's message of mar abr 19 13:33:27 -0300 2011: > On Tue, Apr 19, 2011 at 12:27 PM, Christopher Browne > wrote: > > On Tue, Apr 19, 2011 at 12:22 PM, Robert Haas wrote: > >> Yeah.  I was wondering if anyone was gung-ho enough about this to > >> implement some kind of libra

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Robert Haas
On Tue, Apr 19, 2011 at 12:27 PM, Christopher Browne wrote: > On Tue, Apr 19, 2011 at 12:22 PM, Robert Haas wrote: >> Yeah.  I was wondering if anyone was gung-ho enough about this to >> implement some kind of library that both programs could draw on. >> >> It probably wouldn't be super-hard, if

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Christopher Browne
On Tue, Apr 19, 2011 at 12:22 PM, Robert Haas wrote: > Yeah.  I was wondering if anyone was gung-ho enough about this to > implement some kind of library that both programs could draw on. > > It probably wouldn't be super-hard, if we could agree on a rough design. It seems to me that the Mo Betta

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Robert Haas
On Tue, Apr 19, 2011 at 11:56 AM, Merlin Moncure wrote: >> I do think that DO covers a lot of the same territory that could >> usefully be addressed by a more powerful backslash-command language in >> psql.  It's in some ways quite a bit more powerful, because it's >> available from any client, an

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Merlin Moncure
On Tue, Apr 19, 2011 at 10:22 AM, Robert Haas wrote: > On Mon, Apr 18, 2011 at 5:37 PM, Alvaro Herrera > wrote: >> Excerpts from Merlin Moncure's message of lun abr 18 18:26:54 -0300 2011: >>> On Mon, Apr 18, 2011 at 4:02 PM, Alvaro Herrera >>> wrote: >> >>> > begin; >>> > \for iterator 1 1

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Robert Haas
On Mon, Apr 18, 2011 at 5:37 PM, Alvaro Herrera wrote: > Excerpts from Merlin Moncure's message of lun abr 18 18:26:54 -0300 2011: >> On Mon, Apr 18, 2011 at 4:02 PM, Alvaro Herrera >> wrote: > >> > begin; >> > \for iterator 1 1 >> >  \setrandom foo 1 :iterator >> >  insert into foo values (

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread David Fetter
On Mon, Apr 18, 2011 at 06:02:53PM -0300, Alvaro Herrera wrote: > Hi, > > Today (and previously) I wished that pgbench had a mechanism to help > create simple random databases. For example, I could create a table > "tenk" and fill it with random stuff like > > \setrandom foo 1 1 > insert int

Re: [HACKERS] pgbench \for or similar loop

2011-04-18 Thread Alvaro Herrera
Excerpts from Merlin Moncure's message of lun abr 18 18:26:54 -0300 2011: > On Mon, Apr 18, 2011 at 4:02 PM, Alvaro Herrera > wrote: > > begin; > > \for iterator 1 1 > >  \setrandom foo 1 :iterator > >  insert into foo values (:foo); > > \end > > commit; > > > > Would something like this be

Re: [HACKERS] pgbench \for or similar loop

2011-04-18 Thread Merlin Moncure
On Mon, Apr 18, 2011 at 4:02 PM, Alvaro Herrera wrote: > Hi, > > Today (and previously) I wished that pgbench had a mechanism to help > create simple random databases.  For example, I could create a table > "tenk" and fill it with random stuff like > > \setrandom foo 1 1 > insert into foo valu

[HACKERS] pgbench \for or similar loop

2011-04-18 Thread Alvaro Herrera
Hi, Today (and previously) I wished that pgbench had a mechanism to help create simple random databases. For example, I could create a table "tenk" and fill it with random stuff like \setrandom foo 1 1 insert into foo values (:foo) Now I have to run this 1 times or something like that.