| От | Richard Huxton |
|---|---|
| Тема | Re: [HACKERS] Much Ado About COUNT(*) |
| Дата | |
| Msg-id | 41E81198.6070105@archonet.com обсуждение исходный текст |
| Ответ на | Re: [HACKERS] Much Ado About COUNT(*) ("Frank D. Engel, Jr." <fde101@fjrhome.net>) |
| Список | pgsql-general |
Frank D. Engel, Jr. wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > This is probably stupid for some reason, but why not use a 64-bit > integer to track the number of records in the table? Increment when > adding records, decrement when deleting them... then COUNT(*) could just > return that in cases where a query is known to be looking at all of the > records? Check the list archives for details, but you need to consider multiple backends inserting/deleting concurrently. What you need is a separate little table where you can log your transaction-id and number of rows added/removed then you can figure out how many rows there are from different viewpoints. -- Richard Huxton Archonet Ltd
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера