Re: attdisbursion - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: attdisbursion
Date
Msg-id 199909170149.VAA21525@candle.pha.pa.us
Whole thread Raw
Responses Re: [HACKERS] Re: attdisbursion
List pgsql-hackers
Added to TODO.  This will improve VACUUM ANALYZE performance, thought I
don't think we have btree comparison functions for all data types,
though we should:

* change VACUUM ANALYZE to use btree comparison functions, not <,=,> calls

> > > Also, I have idea about using '<' '>' in vacuum:
> > > what if try to use btree BT_ORDER functions which allow
> > > to compare vals for many data types (btXXXcmp functions in
> > > nbtcompare.c).
> > 
> > I see, use a btree index to tell use how selective the > or < is?  An
> > interesting idea.  Isn't there a significant performance problem with
> > this?
> 
> Don't use btree index, but use btree functions to compare
> two values of a datatype. You call
>     func_operator = oper("<",...
>                              "="
>                              ">"
> but this's not right way in common case: operators may be 
> overloaded. 
> 
> These functions are stored in catalog.
> To get function for a datatype btree call
> 
> proc = index_getprocid(rel, 1, BTORDER_PROC);
> 
> Look @ nbtcompare.c:
> 
>  *      These functions are stored in pg_amproc.  For each operator class
>  *      defined on btrees, they compute
>  *
>  *              compare(a, b):
>  *                      < 0 if a < b,
>  *                      = 0 if a == b,
>  *                      > 0 if a > b.
> 
> There are functions for INTs, FLOATs, ...
> 
> ...But this is not so important thing...
> 
> Vadim
> 


--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: pgaccess seems a tad confused
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] pgaccess seems a tad confused