Performance critical technical key - Mailing list pgsql-general

From Geoff Caplan
Subject Performance critical technical key
Date
Msg-id 166360425184.20040812130545@variosoft.com
Whole thread Raw
In response to Re: Correct escaping of untrusted data  (Geoff Caplan <geoff@variosoft.com>)
Responses Re: Performance critical technical key  (Bruno Wolff III <bruno@wolff.to>)
Re: Performance critical technical key  (Pierre-Frédéric Caillaud<lists@boutiquenumerique.com>)
List pgsql-general
Hi folks

I'm designing a table to be used for web session management. If all
goes well with the project, the table should have 100,000+ records and
be getting hammered with SELECTS, INSERTS and UPDATES.

The table will need a technical key. The question is, what is the most
efficient way to do this?

a) Generate a random 24 character string in the application. Very
quick for the INSERTs, but will the longer key slow down the the
SELECTs and UPDATES?

b) Use a sequence. Faster for the SELECTS and UPDATES, I guess, but
how much will the sequence slow down the INSERTS on a medium sized
record-set?

There will probably be 6-8 SELECTs & UPDATEs for each INSERT.

I appreciate that I could set up some tests, but I am under the hammer
time-wise. Some rule-of-thumb advice from the list would be most
welcome.

------------------
Geoff Caplan
Vario Software Ltd
(+44) 121-515 1154


pgsql-general by date:

Previous
From: Raphael Bauduin
Date:
Subject: Re: history tables with only one function?
Next
From: Renato Cramer
Date:
Subject: Access restrictions on rows depending on value of the a column