Re: [HACKERS] pgbench \for or similar loop

2011-04-23 Thread Dimitri Fontaine
Greg Smith g...@2ndquadrant.com 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

Re: [HACKERS] pgbench \for or similar loop

2011-04-22 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

Re: [HACKERS] pgbench \for or similar loop

2011-04-22 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-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 a

Re: [HACKERS] pgbench \for or similar loop

2011-04-20 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 da...@fetter.org: On Mon, Apr 18, 2011 at 06:02:53PM -0300, Alvaro Herrera wrote:

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

Re: [HACKERS] pgbench \for or similar loop

2011-04-20 Thread Pavel Stehule
2011/4/20 David Fetter da...@fetter.org: 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.

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 allow

Re: [HACKERS] pgbench \for or similar loop

2011-04-20 Thread Merlin Moncure
On Wed, Apr 20, 2011 at 9:14 AM, Alvaro Herrera alvhe...@commandprompt.com 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

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 da...@fetter.org: 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

Re: [HACKERS] pgbench \for or similar loop

2011-04-20 Thread Robert Haas
On Wed, Apr 20, 2011 at 10:46 AM, Merlin Moncure mmonc...@gmail.com wrote: On Wed, Apr 20, 2011 at 9:14 AM, Alvaro Herrera alvhe...@commandprompt.com 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:

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 mmonc...@gmail.com wrote: On Wed, Apr 20, 2011 at 9:14 AM, Alvaro Herrera alvhe...@commandprompt.com wrote: Excerpts from David Fetter's message of mié abr 20 10:54:56 -0300 2011:

Re: [HACKERS] pgbench \for or similar loop

2011-04-20 Thread Robert Haas
On Wed, Apr 20, 2011 at 2:10 PM, David Fetter da...@fetter.org 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

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 da...@fetter.org 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

Re: [HACKERS] pgbench \for or similar loop

2011-04-20 Thread Robert Haas
On Wed, Apr 20, 2011 at 2:23 PM, David Fetter da...@fetter.org 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 da...@fetter.org wrote: It is precisely this kind of issue that leads me to believe it would be counter-productive

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 into foo

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Robert Haas
On Mon, Apr 18, 2011 at 5:37 PM, Alvaro Herrera alvhe...@commandprompt.com 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 alvhe...@alvh.no-ip.org wrote: begin; \for iterator 1 1  \setrandom foo 1

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Merlin Moncure
On Tue, Apr 19, 2011 at 10:22 AM, Robert Haas robertmh...@gmail.com wrote: On Mon, Apr 18, 2011 at 5:37 PM, Alvaro Herrera alvhe...@commandprompt.com 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

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Robert Haas
On Tue, Apr 19, 2011 at 11:56 AM, Merlin Moncure mmonc...@gmail.com 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

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Christopher Browne
On Tue, Apr 19, 2011 at 12:22 PM, Robert Haas robertmh...@gmail.com 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

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Robert Haas
On Tue, Apr 19, 2011 at 12:27 PM, Christopher Browne cbbro...@gmail.com wrote: On Tue, Apr 19, 2011 at 12:22 PM, Robert Haas robertmh...@gmail.com 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

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 cbbro...@gmail.com wrote: On Tue, Apr 19, 2011 at 12:22 PM, Robert Haas robertmh...@gmail.com wrote: Yeah.  I was wondering if anyone was gung-ho enough about this to

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Merlin Moncure
On Tue, Apr 19, 2011 at 11:49 AM, Alvaro Herrera alvhe...@commandprompt.com 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 cbbro...@gmail.com wrote: On Tue, Apr 19, 2011 at 12:22 PM, Robert Haas

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com 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

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 coding

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 t...@sss.pgh.pa.us 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

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 robertmh...@gmail.com 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

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Kevin Grittner
Aidan Van Dyk ai...@highrise.ca 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

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 kevin.gritt...@wicourts.gov wrote: Aidan Van Dyk ai...@highrise.ca 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

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 alvhe...@commandprompt.com 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

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Jeff Janes
On Tue, Apr 19, 2011 at 11:22 AM, Alvaro Herrera alvhe...@commandprompt.com wrote: Excerpts from Tom Lane's message of mar abr 19 14:22:54 -0300 2011: Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Robert Haas's message of mar abr 19 13:33:27 -0300 2011: Well, I'm all good

[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.

Re: [HACKERS] pgbench \for or similar loop

2011-04-18 Thread Merlin Moncure
On Mon, Apr 18, 2011 at 4:02 PM, Alvaro Herrera alvhe...@alvh.no-ip.org 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

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 alvhe...@alvh.no-ip.org wrote: begin; \for iterator 1 1  \setrandom foo 1 :iterator  insert into foo values (:foo); \end commit; Would something like