| От | Richard Huxton |
|---|---|
| Тема | Re: How efficient is select currval? |
| Дата | |
| Msg-id | 43993817.40301@archonet.com обсуждение исходный текст |
| Ответ на | How efficient is select currval? (Chris Velevitch <chris.velevitch@gmail.com>) |
| Список | pgsql-general |
Chris Velevitch wrote: > If I insert a record into a table with a serial primary key, does > select currval fetch it from the database or does it get it from > within memory? > > If it fetches it from the database, should I use a Serializable > transaction or just a read committed transaction? You can control the level of caching, but you'll have to be pushing it for the serial to be a large part of your overheads. Each sequence is a small table - you can do "SELECT * FROM my_seq" and see the "insides". You don't need to worry about transaction isolation for sequences, you are always guaranteed a new value. The price you pay for this is that there might be gaps in the series of values you get. -- Richard Huxton Archonet Ltd
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера