Re: Rows missing from table despite FK constraint - Mailing list pgsql-general

From Konrad Garus
Subject Re: Rows missing from table despite FK constraint
Date
Msg-id 6645f6441001110330s29e67d29t46f9e29fc011bd9c@mail.gmail.com
Whole thread Raw
In response to Re: Rows missing from table despite FK constraint  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
Responses Re: Rows missing from table despite FK constraint  (Konrad Garus <konrad.garus@gmail.com>)
List pgsql-general
2010/1/8 Alban Hertroys <dalroi@solfertje.student.utwente.nl>:

> Did you turn off seqscans in the postgres.conf?

Seq scan is enabled.

> Could you try a "REINDEX TABLE attachment" again in case you somehow reindexed the wrong index or table?

How about this test?

On a dump from before the rows were gone:

# select count(*) from attachment where when_uploaded < '2010-01-01';
  count
----------
 22523642
(1 row)

On production database:

# explain select count(*) from attachment where when_uploaded < '2010-01-01';
                                      QUERY PLAN
--------------------------------------------------------------------------------------
 Aggregate  (cost=1794931.20..1794931.21 rows=1 width=0)
   ->  Seq Scan on attachment  (cost=0.00..1738076.24 rows=22741985 width=0)
         Filter: (when_uploaded < '2010-01-01 00:00:00'::timestamp
without time zone)
(3 rows)

# select count(*) from attachment where when_uploaded < '2010-01-01';
  count
----------
 22523639
(1 row)



--
Konrad Garus

pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: Table appears on listing but can't drop it
Next
From: Ivan Sergio Borgonovo
Date:
Subject: Re: R: aggregate over tables in different schema