[PERFORM] ACCESS EXCLUSIVE lock

2006-10-18 Thread Atesz
Hi! I have a problem with ACCESS EXCLUSIVE lock when I drop a reference in transaction. I have 2 tables: create table a(id SERIAL primary key); create table b(id SERIAL primary key references a(id)); After that I have 2 processes: P1, P2 In P1: begin; ALTER TABLE b DROP CONSTRAINT b_id_fke

Re: [PERFORM] ACCESS EXCLUSIVE lock

2006-10-19 Thread Atesz
Scott Marlowe wrote: What if, a minute or two after the drop contraint, you issue a rollback? After the DROP CONSTRAINT I insert 4 million rekords into the TABLE b. After the inserts I remake the dropped constraints, and commit the transaction (P1). This solution is faster then the conventio

Re: [PERFORM] ACCESS EXCLUSIVE lock

2006-10-25 Thread Atesz
Tom Lane wrote: This isn't going to be changed, because the likely direction of future development is that the planner will start making use of constraints even for SELECT queries. This means that a DROP CONSTRAINT operation could invalidate the plan of a SELECT query, so the locking will be ess

Re: [PERFORM] planner/optimizer question

2004-04-27 Thread Atesz
Hi, You should try the next queries: select support_person_id from ticket_crm_map where crm_id = 7 GROUP BY support_person_id; select support_person_id from ticket_crm_map where crm_id = 1 GROUP BY support_person_id; It can use the 'ticket_crm_map_crm_id_suppid' index. Generally the Postgres u

Re: [PERFORM] Simply join in PostrgeSQL takes too long

2004-04-27 Thread Atesz
Hi, You can try some variation: SELECT book_id FROM bookgenres, genre_children WHERE bookgenres.genre_id = genre_children.genre_child_id AND genre_children.genre_id = 1 GROUP BY book_id LIMIT 10 The next works if the 'genre_child_id' is UNIQUE on the 'genre_children' table. SELEC