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