Re: Not using index - Mailing list pgsql-general

From Joerg Hessdoerfer
Subject Re: Not using index
Date
Msg-id 5.0.2.1.0.20010207162844.00a84970@192.168.0.1
Whole thread Raw
In response to Not using index  (Crispin Miller <crispin@cs.man.ac.uk>)
List pgsql-general
At 14:47 07.02.01 +0000, you wrote:
>Hi,
>I have a table with about 8million tuples in it. I need to do a search
>on two of the table's columns, so I've created a couple of indices, one
>for each column.
>Then I've run VACUUM ANALYZE. The query planner still wants to do a
>sequential scan on the database. Any idea where I'm going wrong?
>Crispin

For this, you need to create an index on BOTH columns, e.g.

'create index foo on bar ( baz, bang )'

That should help.

Greetings,
         Joerg


pgsql-general by date:

Previous
From: Brice Ruth
Date:
Subject: Re: [SQL] Re: SQL Join - MySQL/PostgreSQL difference?
Next
From: Gunnar R|nning
Date:
Subject: Re: full text searching