Re: [HACKERS] [GENERAL] Bug with sequence

2002-11-26 Thread Peter Gulutzan
[EMAIL PROTECTED] (scott.marlowe) wrote in message 
news:[EMAIL PROTECTED]...
 On 21 Nov 2002, Rod Taylor wrote:
 
  On Thu, 2002-11-21 at 15:09, scott.marlowe wrote:
   On 21 Nov 2002, Rod Taylor wrote:
   
On Thu, 2002-11-21 at 14:11, Bruce Momjian wrote:
 Of course, those would be SQL purists who _don't_ understand
 concurrency issues.  ;-)

Or they're the kind that locks the entire table for any given insert.
   
   Isn't that what Bruce just said?  ;^)
  
  I suppose so.  I took what Bruce said to be that multiple users could
  get the same ID.
  
  I keep having developers want to make their own table for a sequence,
  then use id = id + 1 -- so they hold a lock on it for the duration of
  the transaction.
 
 I was just funnin' with ya, but the point behind it was that either way 
 (with or without a lock) that using something other than a sequence is  
 probably a bad idea.  Either way, under parallel load, you have data 
 consistency issues, or you have poor performance issues.
 
 
I'm not familiar with these SQL purists (perhaps the reference is to
J. Celko?) but the fact is that it's hard to call SEQUENCE
product-specific now that it's in Oracle, DB2, and SQL:2003. The
syntaxes do differ a little, usually due to choice of abbreviation,
but as far as I can tell the internals are similar across
implementations.

Peter Gulutzan
Author of Sequences And Identity Columns
(http://dbazine.com/gulutzan4.html)

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



Re: [HACKERS] Inheritance

2002-09-03 Thread Peter Gulutzan

The August draft of the SQL:200n standard (9075-2 Foundation) says in
Section 4.17.2: Every table constraint specified for base table T is
implicitly a constraint on every subtable of T, by virtue of the fact
that every row in a subtable is considered to have a corresponding
superrow in every one of its supertables.

Peter Gulutzan
Co-Author, SQL-99 Complete, Really
Co-Author, SQL Performance Tuning

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly