On Tue, Aug 02, 2005 at 10:41:01AM -0500, Dan Armbrust wrote: > But it is rather easy to get into rant mode when the prevailing > opinion is that not being able to insert rows into a table with a > foreign key without running Analyze after X rows is a misuse of the > DB, rather than a bug. I havn't seen it in this thread but it reminds me of someone who had a similar problem a long time ago. Basically, he was doing: TRUNCATE ANALYZE <load database> This screwed everything up, because the ANALYZE set the statistics to zero size tables. The solution was: *Don't* analyze the table when it's empty. If he left out the ANALYZE altogether it worked. It also works because just after a CREATE TABLE it defaults to using indexes too. The *only* time it starts worrying about seq scans is if you run ANALYZE on an empty table. So don't do that. Hope this helps, -- Martijn van Oosterhout <kleptog@xxxxxxxxx> http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them.
Attachment:
pgpwxPn7y3T47.pgp
Description: PGP signature