pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rudi Starcevic <rudi@oasis.net.au>
To: pgsql-sql@postgresql.org
Subject: Analyze + Index
Date: Fri, 29 Nov 2002 14:04:17 +1000
Message-ID: <3DE6E741.3010406@oasis.net.au> (raw)

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.




view thread (3+ messages)  latest in thread

Message-ID: <3DE6E741.3010406@oasis.net.au>
Permalink:  ../3DE6E741.3010406@oasis.net.au/
Also on:    postgresql.org/message-id/3DE6E741.3010406@oasis.net.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rudi@oasis.net.au
  Subject: Re: Analyze + Index
  In-Reply-To: <3DE6E741.3010406@oasis.net.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox