Search Postgresql Archives

waiting on index drop

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

 



Hi!

Does Postgres needs to wait for this lock
or is this something that can be fixed?


Create data:

create table test_table
(
	id varchar primary key
);

insert into test_table
select i::text
from generate_series(1000,100000) i;


Session 1:
select * from test_table where id like '1050%';
Uses seq_scan

Session 2:
begin transaction;
create index ix_1 on test_table(id) where id like '1050%';
select * from test_table where id like '1050%';
Uses indx_scan

Session 1:
select * from test_table where id like '1050%';
Uses seq_scan (great, index is not visible)

Session 2:
drop index ix_1;
select * from test_table where id like '1050%';
Uses seq_scan

Session 1:
select * from test_table where id like '1050%';
Blocked

Session 2:
commit;
Session 1 continues

Regards,
Rikard

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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