Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 93981475BD7 for ; Thu, 28 Nov 2002 23:05:34 -0500 (EST) Received: from water.oasis.net.au (water.oasis.net.au [210.8.139.2]) by postgresql.org (Postfix) with ESMTP id 53022475B8F for ; Thu, 28 Nov 2002 23:05:33 -0500 (EST) Received: from oasis.net.au (guardian [210.8.139.5]) by water.oasis.net.au (8.9.3/100.1) with ESMTP id OAA26026 for ; Fri, 29 Nov 2002 14:43:22 +1000 X-Authentication-Warning: water.oasis.net.au: Host guardian [210.8.139.5] claimed to be oasis.net.au Message-ID: <3DE6E741.3010406@oasis.net.au> Date: Fri, 29 Nov 2002 14:04:17 +1000 From: Rudi Starcevic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Analyze + Index Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/429 X-Sequence-Number: 10571 Hi, Say I have a table of 3000 user's, Before I insert another user I need to check if that user is already in there, so I have a 3 column index on a table ( phone,lastname,firstname ). First I check for the user using the index if they are not in there I then add an new user so I now have 3001. For my next user I then check again using the same procedure. Is the following correct ? As I have not yet Analyzed the db my index is still 3000 rows and my user table is 3001. If I add another user my index is still 3000 and my table 3002. So I either analyze after each insert or use a seqential scan. I wonder this as I have a csv file of users to bulk insert each day. Typically I'll have a file of 1500 or so users to add or append data to. Thanks.