DB Sequences

From: Date: Wed, 17 Jul 2002 12:16:08 +0000
Subject: DB Sequences
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-1907@lists.php.net to get a copy of this message
For MySQL (maybe others) sequence emulation, why create a new table for each sequence? Would it not be more efficient to create one table say "PEAR_Sequences" with 2 columns "sequence_name" and "sequence_id" and just add rows to the table for each sequence as it is needed, it would allow MySQL users with privileges for only INSERT, UPDATE, DELETE and SELECT to use sequences without needing CREATE privileges if the sequence did not exist, altough they would have had to create the table in the first place :) It would also look a bit more tidy when you don't have a sequence table for every table in your DB. Maybe the table approach is more efficient? I don't know, it's just an idea and I was just curious as to the reasons for using tables. regards alan

« previous php.pear.general (#1907) next »