Christopher Browne cbbrowne
Tue Jan 30 10:59:23 PST 2007
Mark Stosberg wrote:
> This post suggested a performance improvement to the initial copy might
> appear in 1.2, by removing indexes and re-applying them.
>
> http://gborg.postgresql.org/pipermail/slony1-general/2005-June/002285.html
>
> >From reading RELEASE-1.2.0, I didn't see a mention to that effect. Is an
> optimization like this in place?
>
> If not, is the recommended practice to drop all the non-primary-key
> indexes, and then re-apply them later?
>   
That change is in place:

 prepareTableForCopy(tab_id) added the code:

    -- Setting pg_class.relhasindex to false will cause copy not to
    -- maintain any indexes. At the end of the copy we will reenable
    -- them and reindex the table. This bulk creating of indexes is
    -- faster.
    -- ----
    update pg_class set relhasindex = ''f'' where oid = v_tab_oid;

finishTableAfterCopy(tab_id) added:

    -- ----
    -- Reenable indexes and reindex the table.
    -- ----
    update pg_class set relhasindex = ''t'' where oid = v_tab_oid;
    execute ''reindex table '' ||
@NAMESPACE at .slon_quote_input(v_tab_fqname);

This was added in 1.1.5, before 1.2 was released...

As a result, "recommended practice" is to leave the indexes alone.



More information about the Slony1-general mailing list