Received: from mail.computalog.com ([209.82.103.230]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4UMUdE07444 for ; Wed, 30 May 2001 18:30:39 -0400 (EDT) (envelope-from linh.luong@computalog.com) Received: from jamie.edmonton.computalog.com (mugeri.computalog.com [209.82.103.229]) by mail.computalog.com (8.8.8/8.8.8) with ESMTP id QAA29394 for ; Wed, 30 May 2001 16:30:55 -0600 Received: from computalog.com (localhost [127.0.0.1]) by jamie.edmonton.computalog.com (Postfix) with ESMTP id 69243197399 for ; Wed, 30 May 2001 16:37:59 -0600 (MDT) Message-ID: <3B157646.EABF2998@computalog.com> Date: Wed, 30 May 2001 16:37:58 -0600 From: Linh Luong X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-pentiumiii-smp i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Using indexes Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200105/348 X-Sequence-Number: 3189 Hi, Indexes are used to find a record faster in a table. It only seems to work if I am working with one table. eg) > create index customer_id_idx on customer(id); > select * from customer where id=1; -- This uses the index I create However, when I start to join 2 or more tables together it doesn't seem to use it.. WHY??? eg) > create index customer_id_idx on customer(id); > select * from customer, purchaseorder where customer.id=purchaseorder.id; -- This results in a seq scan .. WHY?? Is there a way to make it so that it uses my index Thanks again.