Re: [PERFORM] COUNT(*) again (was Re: [HACKERS] Index/Function organized table layout)

2003-10-05 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes:
 Tom Lane wrote:
 I think that's not happening, conditionally or otherwise.  The atomicity
 problems alone are sufficient reason why not, even before you look at
 the performance issues.

 What are the atomicity problems of adding a create/expire xid to the
 index tuples?

You can't update a tuple's status in just one place ... you have to
update the copies in the indexes too.

regards, tom lane

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [PERFORM] COUNT(*) again (was Re: [HACKERS] Index/Function organized

2003-10-05 Thread Bruce Momjian
Tom Lane wrote:
 Bruce Momjian [EMAIL PROTECTED] writes:
  Tom Lane wrote:
  I think that's not happening, conditionally or otherwise.  The atomicity
  problems alone are sufficient reason why not, even before you look at
  the performance issues.
 
  What are the atomicity problems of adding a create/expire xid to the
  index tuples?
 
 You can't update a tuple's status in just one place ... you have to
 update the copies in the indexes too.

But we don't update the tuple status for a commit, we just mark the xid
as committed.  We do have lazy status bits that prevent later lookups in
pg_clog, but we have those in the index already also.

What am I missing?

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [PERFORM] COUNT(*) again (was Re: [HACKERS] Index/Function

2003-10-04 Thread Hannu Krosing
Tom Lane kirjutas L, 04.10.2003 kell 19:07:
 Hannu Krosing [EMAIL PROTECTED] writes:
  Christopher Browne kirjutas R, 03.10.2003 kell 00:57:
  A while back I outlined how this would have to be done, and for it to
  be done efficiently, it would be anything BUT simple.  
 
  Could this be made a TODO item, perhaps with your attack plan. 
 
 If I recall that discussion correctly, no one including Christopher
 thought the attack plan was actually reasonable.
 
 What this keeps coming down to is that an optimization that helps only
 COUNT(*)-of-one-table-with-no-WHERE-clause would be too expensive in
 development and maintenance effort to justify its existence.

Please read further in my email ;)

The point I was trying to make was that faster count(*)'s is just a side
effect. If we could (conditionally) keep visibility info in indexes,
then this would also solve the problem fo much more tricky question of
index-structured tables.

Count(*) is *not* the only query that could benefit from not needing to
go to actual data table for visibilty info, The much more needed case
would be the inveres time series type of queries, which would
otherways trash cache pages badly.


Hannu


---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PERFORM] COUNT(*) again (was Re: [HACKERS] Index/Function organized table layout)

2003-10-04 Thread Tom Lane
Hannu Krosing [EMAIL PROTECTED] writes:
 The point I was trying to make was that faster count(*)'s is just a side
 effect. If we could (conditionally) keep visibility info in indexes,

I think that's not happening, conditionally or otherwise.  The atomicity
problems alone are sufficient reason why not, even before you look at
the performance issues.

regards, tom lane

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [PERFORM] COUNT(*) again (was Re: [HACKERS] Index/Function organized

2003-10-04 Thread Bruce Momjian
Tom Lane wrote:
 Hannu Krosing [EMAIL PROTECTED] writes:
  The point I was trying to make was that faster count(*)'s is just a side
  effect. If we could (conditionally) keep visibility info in indexes,
 
 I think that's not happening, conditionally or otherwise.  The atomicity
 problems alone are sufficient reason why not, even before you look at
 the performance issues.

What are the atomicity problems of adding a create/expire xid to the
index tuples?

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 8: explain analyze is your friend