Re: [SQL] delete and select with IN clause issues

2006-11-08 Thread Jeff Frost
On Tue, 7 Nov 2006, Jeff Frost wrote: Well, it's been working wonderfully since the REINDEX, so I don't know what to say. Any idea if having a too small max_fsm_pages could hose an index, because I know that happened not too long before we started seeing this problem. The fsm settings were i

Re: [SQL] delete and select with IN clause issues

2006-11-07 Thread Jeff Frost
On Fri, 3 Nov 2006, Tom Lane wrote: Well, I can't find anything wrong :-(. There are some differences in the list of contained keys, but they're all up near the end of the range, which is consistent with the assumption that the table is live and had some changes between your two dumps of the in

Re: [SQL] delete and select with IN clause issues

2006-11-03 Thread Jeff Frost
On Fri, 3 Nov 2006, Tom Lane wrote: Jeff Frost <[EMAIL PROTECTED]> writes: Well, I spoke to soon on the it all works front. So, it's been reindexed and appears to be working properly now. I guess I'll keep an eye on it for a while. I didn't get your query suggestion in time, so hopefully I g

Re: [SQL] delete and select with IN clause issues

2006-11-03 Thread Tom Lane
Jeff Frost <[EMAIL PROTECTED]> writes: > Well, I spoke to soon on the it all works front. So, it's been > reindexed and appears to be working properly now. I guess I'll keep > an eye on it for a while. I didn't get your query suggestion in time, > so hopefully I grabbed the right binary file..th

Re: [SQL] delete and select with IN clause issues

2006-11-02 Thread Jeff Frost
On Fri, 3 Nov 2006, Tom Lane wrote: Jeff Frost <[EMAIL PROTECTED]> writes: BTW, just to make sure I get the right file to ship over if we have this again, it would be: /var/lib/pgsql/data/base/9366228/16204210 yes? Not necessarily --- the filename is initially the same as the index OID, but i

Re: [SQL] delete and select with IN clause issues

2006-11-02 Thread Tom Lane
Jeff Frost <[EMAIL PROTECTED]> writes: > BTW, just to make sure I get the right file to ship over if we have this > again, it would be: /var/lib/pgsql/data/base/9366228/16204210 yes? Not necessarily --- the filename is initially the same as the index OID, but it wouldn't be anymore after a REINDE

Re: [SQL] delete and select with IN clause issues

2006-11-02 Thread Jeff Frost
On Fri, 3 Nov 2006, Tom Lane wrote: Jeff Frost <[EMAIL PROTECTED]> writes: On Thu, 2 Nov 2006, Tom Lane wrote: This seems pretty darn weird. I am wondering about corrupt indexes --- can you find the indicated key in either table if you set enable_indexscan and enable_bitmapscan to 0? That's

Re: [SQL] delete and select with IN clause issues

2006-11-02 Thread Tom Lane
Jeff Frost <[EMAIL PROTECTED]> writes: > On Thu, 2 Nov 2006, Tom Lane wrote: >> This seems pretty darn weird. I am wondering about corrupt indexes --- >> can you find the indicated key in either table if you set >> enable_indexscan and enable_bitmapscan to 0? > test_tracking=# begin; > BEGIN > te

Re: [SQL] delete and select with IN clause issues

2006-11-02 Thread Jeff Frost
On Thu, 2 Nov 2006, Tom Lane wrote: Jeff Frost <[EMAIL PROTECTED]> writes: delete from visit where id not in (select distinct visit_id from page_view); This yields the following error: ERROR: update or delete on "visit" violates foreign key constraint "fk34afd255fbacabec" on "page_view"

Re: [SQL] delete and select with IN clause issues

2006-11-02 Thread Tom Lane
Jeff Frost <[EMAIL PROTECTED]> writes: > delete from visit where id not in (select distinct visit_id from page_view); > This yields the following error: > ERROR: update or delete on "visit" violates foreign key constraint > "fk34afd255fbacabec" on "page_view" > DETAIL: Key (id)=(38635629) is s

Re: [SQL] delete and select with IN clause issues

2006-11-02 Thread Jeff Frost
On Thu, 2 Nov 2006, Jeff Frost wrote: I'm having problem with a cleanup script that runs nightly. The script calls the following query: delete from visit where id not in (select distinct visit_id from page_view); This yields the following error: ERROR: update or delete on "visit" violates

[SQL] delete and select with IN clause issues

2006-11-02 Thread Jeff Frost
I'm having problem with a cleanup script that runs nightly. The script calls the following query: delete from visit where id not in (select distinct visit_id from page_view); This yields the following error: ERROR: update or delete on "visit" violates foreign key constraint "fk34afd255fbaca