Re: PATCH: CreateComments: use explicit indexing for ``values'' - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PATCH: CreateComments: use explicit indexing for ``values''
Date
Msg-id 27858.1308061828@sss.pgh.pa.us
Whole thread Raw
In response to Re: PATCH: CreateComments: use explicit indexing for ``values''  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: PATCH: CreateComments: use explicit indexing for ``values''
Re: PATCH: CreateComments: use explicit indexing for ``values''
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Excerpts from richhguard-monotone's message of lun jun 13 16:10:17 -0400 2011:
>> Do you have any advice of how to handle the inner loops, such as those initializing ``stakindN''. The entries before
canbe handled just like in this patch, by using the symbolic constants.
 

> Based on Tom's comments, I'd submit the patch without that bit, at least
> as a first step.

He already did no?

I did think of a possible way to rewrite update_attstats: instead of
       for (k = 0; k < STATISTIC_NUM_SLOTS; k++)       {           values[i++] = ObjectIdGetDatum(stats->staop[k]);
/*staopN */       }
 

do
       for (k = 0; k < STATISTIC_NUM_SLOTS; k++)       {           values[Anum_pg_statistic_staop1 - 1 + k] =
ObjectIdGetDatum(stats->staop[k]);      }
 

etc.  However, it's not clear to me whether this is really an
improvement.  Opinions?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Cédric Villemain
Date:
Subject: [WIP] cache estimates, cache access cost
Next
From: Alvaro Herrera
Date:
Subject: Re: ITYM DROP TABLE