Search Postgresql Archives

are there any method that "Update" command not affect other unrelated indices?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, I have the following table:
CREATE TABLE A
(
ÂÂ a1 integer not null,
ÂÂ a2 integer,
ÂÂ a3 integer,
ÂÂ a4 integer
)
and have the following four indices:
create index ind_a1 on A USING gist(a1);
create index ind_a2 on A USING gist(a2);
create index ind_a3 on A USING gist(a3);
create index ind_a4 on A USING gist(a4);

now we have 10,000 update command executions using spi_exeplan():
SPI_prepare(); // prepare the plan for "update A set a4 = $1;"
for(i=0;i<10000;i++ ){
ÂÂ SPI_execute_plan();//ÂÂ update A set a4 = i;Â
}

the question is why all four indices updated in the execution of SPI_execute_plan()?Â
I think there should only one index, that is ind_a4 be updated, how to avoid other three indices updated?
thanks!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux