Re: [GENERAL] How much clustered?

2006-02-26 Thread Bruce Momjian
Tom Lane wrote:
> Bruce Momjian  writes:
> > Currently we output the ctid as a string:
> > snprintf(buf, sizeof(buf), "(%u,%u)", blockNumber, offsetNumber);
> > Perhaps someday we should consider outputting that as an array or a
> > result set:
> 
> It's not an array, because the two components are not of the same data
> type; and it's not a result set, any more than (say) a point or a box
> is.  What it is is a record datatype.
> 
> There might be some usefulness to adding SQL functions to allow
> extraction of the block number and item number fields, though we'd have
> some problems with the lack of a uint4 datatype to represent the block
> number field's type.  The demand for this has been too low to make me
> feel we need to expend that effort...

Agreed, I was just pointing out that someday it might need improvement.

-- 
  Bruce Momjian   http://candle.pha.pa.us
  SRA OSS, Inc.   http://www.sraoss.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [GENERAL] How much clustered?

2006-02-26 Thread Tom Lane
Bruce Momjian  writes:
> Currently we output the ctid as a string:
>   snprintf(buf, sizeof(buf), "(%u,%u)", blockNumber, offsetNumber);
> Perhaps someday we should consider outputting that as an array or a
> result set:

It's not an array, because the two components are not of the same data
type; and it's not a result set, any more than (say) a point or a box
is.  What it is is a record datatype.

There might be some usefulness to adding SQL functions to allow
extraction of the block number and item number fields, though we'd have
some problems with the lack of a uint4 datatype to represent the block
number field's type.  The demand for this has been too low to make me
feel we need to expend that effort...

regards, tom lane

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [GENERAL] How much clustered?

2006-02-24 Thread Bruce Momjian
Tom Lane wrote:
> Carlos Henrique Reimer <[EMAIL PROTECTED]> writes:
> >   I would like to know how much clustered is a table related to some 
> > index How can I discover?
> 
> You could do
>   select ctid from mytable order by indexcolumns
> and then do whatever sort of calculation strikes your fancy on the
> sequence of page numbers.  (It's probably fair to ignore the row
> numbers, considering an index to be fully clustered if the page
> reference sequence is perfect.)

Currently we output the ctid as a string:

snprintf(buf, sizeof(buf), "(%u,%u)", blockNumber, offsetNumber);

Perhaps someday we should consider outputting that as an array or a
result set:

test=> select x from (select 1, 2) as x;
   x
---
 (1,2)
(1 row)

-- 
  Bruce Momjian   http://candle.pha.pa.us
  SRA OSS, Inc.   http://www.sraoss.com

  + If your life is a hard drive, Christ can be your backup. +

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

   http://archives.postgresql.org


Re: [GENERAL] How much clustered?

2006-02-16 Thread Tom Lane
Carlos Henrique Reimer <[EMAIL PROTECTED]> writes:
>   I would like to know how much clustered is a table related to some 
> index How can I discover?

You could do
select ctid from mytable order by indexcolumns
and then do whatever sort of calculation strikes your fancy on the
sequence of page numbers.  (It's probably fair to ignore the row
numbers, considering an index to be fully clustered if the page
reference sequence is perfect.)

regards, tom lane

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


[GENERAL] How much clustered?

2006-02-16 Thread Carlos Henrique Reimer
Hi,     I would like to know how much clustered is a table related to some index How can I discover?     Reimer
		 
Yahoo! doce lar. Faça do Yahoo! sua homepage.