Re: Spped of max
От | Martijn van Oosterhout |
---|---|
Тема | Re: Spped of max |
Дата | |
Msg-id | 20020516010612.A14367@svana.org обсуждение исходный текст |
Ответ на | Re: Spped of max (Jean-Luc Lachance <jllachan@nsd.ca>) |
Список | pgsql-general |
On Wed, May 15, 2002 at 10:24:55AM -0400, Jean-Luc Lachance wrote: > The real question is: > > Why is reltuples only an approximation? It's only an approximation because it is updated by VACUUM. It's used to estimate the cost of queries. Secondly, remember that there is not really a canonical number-of-tuples-in-a-table. If you start a transaction and insert a row, you'll see one more row than any other transaction running at the time. If you're using a trigger to keep a count of the total, you'll get different answers depending on whether your trigger is deferred or not. I have no idea what happens if the trigger is not deferred but a transaction aborts. Deadlock? I wish people would remember this before declaring the total number of tuples in a table a trivial problem. HTH, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > Canada, Mexico, and Australia form the Axis of Nations That > Are Actually Quite Nice But Secretly Have Nasty Thoughts About America
В списке pgsql-general по дате отправления: