Re: [HACKERS] [PATCHES] WITH RECURSIVE patch V0.1

2008-05-28 Thread Josh Berkus

Tom,


I think this patch is plenty complicated enough without adding useless
restrictive options.


+1 for no additonal GUC options.

--Josh Berkus


--
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


Re: [HACKERS] [PATCHES] WITH RECURSIVE patch V0.1

2008-05-25 Thread Hans-Juergen Schoenig

Gregory Stark wrote:

Joshua D. Drake [EMAIL PROTECTED] writes:

  

Couldn't we just have it pay attention to the existing
max_stack_depth?
  

Recursive query does not consume stack. The server enters an infinite
loop without consuming stack. Stack-depth error does not happen.


We could have a separate guc variable which limits the maximum number of
levels of recursive iterations. That might be a useful feature for DBAs that
want to limit their users from issuing an infinite query.
  

statement_timeout :)



Good point.

Though it occurs to me that if you set FETCH_COUNT in psql (or do the
equivalent in your code ) statement_timeout becomes much less useful.

  


i don't think statement_timeout is a good idea at all.
it is not deterministic. depending on the load on the server some 
queries will execute while others fail.

a separate GUC is needed.

   best regards,

  hans



--
Cybertec Schönig  Schönig GmbH
PostgreSQL Solutions and Support
Gröhrmühlgasse 26, A-2700 Wiener Neustadt
Tel: +43/1/205 10 35 / 340
www.postgresql-support.de, www.postgresql-support.com


--
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


Re: [HACKERS] [PATCHES] WITH RECURSIVE patch V0.1

2008-05-25 Thread Joshua D. Drake

Hans-Juergen Schoenig wrote:

Gregory Stark wrote:

Joshua D. Drake [EMAIL PROTECTED] writes:


  


i don't think statement_timeout is a good idea at all.
it is not deterministic. depending on the load on the server some 
queries will execute while others fail.

a separate GUC is needed.


I don't think we need to add clutter to GUC for something that exists to 
handle the problem at hand. If our real concern is server utilization 
based on user or query resources we need to look at an overall solution 
for that issue not a one off for a single feature.


Sincerely,

Joshua D. Drake



--
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


Re: [HACKERS] [PATCHES] WITH RECURSIVE patch V0.1

2008-05-25 Thread Tom Lane
[ catching up on back email ]

Gregory Stark [EMAIL PROTECTED] writes:
 Yoshiyuki Asaba [EMAIL PROTECTED] writes:
 Recursive query does not consume stack. The server enters an infinite
 loop without consuming stack. Stack-depth error does not happen.

 We could have a separate guc variable which limits the maximum number of
 levels of recursive iterations. That might be a useful feature for DBAs that
 want to limit their users from issuing an infinite query.

This whole thread seems to be proposing more and more complicated
solutions for what is really a non-problem given Yoshiyuki-san's point.
It's trivial to construct SQL queries that will run for longer than the
MTBF of your hardware --- eg, forget a few join constraints.  We've
gotten along fine with nothing but query cancel and statement_timeout
for that, and I've seen no one proposing that we need to fix it.
We don't disallow you from writing an infinite loop in plpgsql, either.

I think this patch is plenty complicated enough without adding useless
restrictive options.

regards, tom lane

-- 
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


Re: [HACKERS] [PATCHES] WITH RECURSIVE patch V0.1

2008-05-23 Thread David Fetter
On Sat, May 24, 2008 at 05:01:11AM +0900, Yoshiyuki Asaba wrote:
 Hi,
 
 From: David Fetter [EMAIL PROTECTED]
 Subject: Re: [PATCHES] WITH RECURSIVE patch V0.1
 Date: Fri, 23 May 2008 11:26:30 -0700
 
  Where is the new patch?
 
 I will create the revised patch on June.  This is a patch for this
 problem.

Thanks very much :)

Cheers,
David.
-- 
David Fetter [EMAIL PROTECTED] http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter  XMPP: [EMAIL PROTECTED]

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

-- 
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


Re: [HACKERS] [PATCHES] WITH RECURSIVE patch V0.1

2008-05-21 Thread Yoshiyuki Asaba
Hi,

From: David Fetter [EMAIL PROTECTED]
Subject: Re: [HACKERS] [PATCHES] WITH RECURSIVE patch V0.1
Date: Mon, 19 May 2008 04:36:30 -0700

   I think it's the other way around. The server should not emit
   infinite number of records.
  
  How about adding new GUC parameter max_recursive_call?
 
 Couldn't we just have it pay attention to the existing
 max_stack_depth?

Recursive query does not consume stack. The server enters an infinite
loop without consuming stack. Stack-depth error does not happen.

Regards,
--
Yoshiyuki Asaba
[EMAIL PROTECTED]

-- 
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


Re: [HACKERS] [PATCHES] WITH RECURSIVE patch V0.1

2008-05-21 Thread Joshua D. Drake

  Couldn't we just have it pay attention to the existing
  max_stack_depth?
 
  Recursive query does not consume stack. The server enters an infinite
  loop without consuming stack. Stack-depth error does not happen.
 
 We could have a separate guc variable which limits the maximum number of
 levels of recursive iterations. That might be a useful feature for DBAs that
 want to limit their users from issuing an infinite query.
 

statement_timeout :)

Joshua D. Drake




-- 
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


Re: [HACKERS] [PATCHES] WITH RECURSIVE patch V0.1

2008-05-21 Thread Gregory Stark
Joshua D. Drake [EMAIL PROTECTED] writes:

  Couldn't we just have it pay attention to the existing
  max_stack_depth?
 
  Recursive query does not consume stack. The server enters an infinite
  loop without consuming stack. Stack-depth error does not happen.
 
 We could have a separate guc variable which limits the maximum number of
 levels of recursive iterations. That might be a useful feature for DBAs that
 want to limit their users from issuing an infinite query.

 statement_timeout :)

Good point.

Though it occurs to me that if you set FETCH_COUNT in psql (or do the
equivalent in your code ) statement_timeout becomes much less useful.

-- 
  Gregory Stark
  EnterpriseDB  http://www.enterprisedb.com
  Ask me about EnterpriseDB's On-Demand Production Tuning

-- 
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


Re: [HACKERS] [PATCHES] WITH RECURSIVE patch V0.1

2008-05-18 Thread Mark Mielke

Merlin Moncure wrote:

On Sun, May 18, 2008 at 5:22 PM, Zoltan Boszormenyi [EMAIL PROTECTED] wrote:
  

Can we get the rows in tree order, please? I.e. something like this:



Is ordering by tree order defined in the standard when no explicit
order is given?  If not, it probably returns them in the order they
are pulled up, which might be the fastest way


+1 for the fastest way, which I expect to often be find all level 1 
matches, find all level 2 matches, ... If ORDER BY is important, it 
should be specified (although it may be difficult or impossible to 
properly represent ORDER BY for a tree? not sure?) I think most uses of 
recursive require extra client side code to deal with anyways, so only 
relative order is important (order within a particular branch).


There are things I'd like to use this for right now. Currently I use 
plpgsql procedures to implement my own recursion. :-)


Cheers,
mark

--
Mark Mielke [EMAIL PROTECTED]