[GENERAL] Simulating sequences

2003-08-18 Thread Vilson farias
Greetings, I'm getting a big performance problem and I would like to ask you what would be the reason, but first I need to explain how it happens. Let's suppose I can't use sequences (it seams impossible but my boss doesn't like specific database features like this one). For sequence

Re: [GENERAL] Simulating sequences

2003-08-18 Thread Dennis Gearon
I would collect the way that 5-10 of the top databases handle unique id's (sequences) for columns and compare them in a small paper. Show your boss that sequences are fairly standard and he should come around. Vilson farias wrote: Greetings, I'm getting a big performance problem and I would

Re: [GENERAL] Simulating sequences

2003-08-18 Thread Paul Ramsey
Vilson farias wrote: Does PostgreSQL sequences deal with these kinds performance questions? Is it clean, fast and secury to use sequences? Maybe I still can make up my boss mind about this subject if I get good arguments here to justify the use of sequences. Sorry, but you just outlined a

Re: [GENERAL] Simulating sequences

2003-08-18 Thread Jan Wieck
Vilson farias wrote: Greetings, I'm getting a big performance problem and I would like to ask you what would be the reason, but first I need to explain how it happens. Let's suppose I can't use sequences (it seams impossible but my boss doesn't like specific database features like this one).

Re: [GENERAL] Simulating sequences

2003-08-18 Thread Bruno Wolff III
On Mon, Aug 18, 2003 at 11:27:14 -0300, Vilson farias [EMAIL PROTECTED] wrote: I tryied to fix this problem with a VACUUM and it was completly ineffective. After execution the problem was still there. Later, after execution of every kind of vacuum I knew (with and without ANALYZE, especific

Re: [GENERAL] Simulating sequences

2003-08-18 Thread Tino Wildenhain
Hi Vilson, Vilson farias wrote: Does PostgreSQL sequences deal with these kinds performance questions? Is it clean, fast and secury to use sequences? Maybe I still can make up my boss mind about this subject if I get good arguments here to justify the use of sequences. Yes, exactly. Its clean,

Re: [GENERAL] Simulating sequences

2003-08-18 Thread btober
wouldn't a better situation be ADDING a record that is one higher, and then doing a select MAX()? The different triggers could do delete on the old records. In my case that would not apply, because what I had was a need to keep a sequence counter for each employee, so I added a column

Re: [GENERAL] Simulating sequences

2003-08-18 Thread Tom Lane
Vilson farias [EMAIL PROTECTED] writes: Let's suppose I can't use sequences (it seams impossible but my boss doesn't like specific database features like this one). If sequences could be effectively replaced by standard SQL operations, we would not have bothered to invent them. Nor would

Re: [GENERAL] Simulating sequences

2003-08-18 Thread Dustin Sallings
On Monday, Aug 18, 2003, at 07:27 US/Pacific, Vilson farias wrote: Greetings, I'm getting a big performance problem and I would like to ask you what would be the reason, but first I need to explain how it happens. Let's suppose I can't use sequences (it seams impossible but my boss doesn't

Re: [GENERAL] Simulating sequences

2003-08-18 Thread Dustin Sallings
On Monday, Aug 18, 2003, at 09:01 US/Pacific, [EMAIL PROTECTED] wrote: With those items in mind, your function could become: CREATE FUNCTION key_generation(integer, varchar(20)) RETURNS integer AS' DECLARE the_department ALIAS FOR $1; the_table_name ALIAS FOR $2; BEGIN IF NOT