Re: Idea for pear sequence tables

From: Date: Tue, 16 Sep 2003 08:17:31 +0000
Subject: Re: Idea for pear sequence tables
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-21538@lists.php.net to get a copy of this message
Tomas V.V.Cox wrote:
On Friday, September 12, 2003 17:52, Stowe, Nola wrote:
I'm sure someone has thought of this and you have a good reason for NOT doing it.. but..I'm curious on why you didn't do it this way?
Instead of having another table created for each table I need a sequence on, what about having a sequence table (seq_name, seq_key) with rows for each table and then just fetching and updating that table with the next key?
Well, a sequences is just that a pool of unique id's for using in your tables. I never understood why one would like to have multiple sequences, while just one for all your tables is enough. I'm not postive about this, but I think having one sequence for all your tables slows things down. A lock will be accuired to get the unique ID, so if there is a lot of data written to various tables all using the same sequence they all have to wait for eachother to get the next ID.
Another reason is different tables might use different sequences: Table A might use 2,4,6,8,10 ... Table B might use 2003.001, 2003.002, 2003.003, 2003.004 .... HTH Jeroen

« previous php.pear.dev (#21538) next »