Indexes works only on miss - Mailing list pgsql-general

From Sebastjan Trepca
Subject Indexes works only on miss
Date
Msg-id cd329af80601060842h436fbf44q58ed99458053baf@mail.gmail.com
Whole thread Raw
Responses Re: Indexes works only on miss
Re: Indexes works only on miss
List pgsql-general
Hi,

I really don't understand this behaviour. I have a table with column "owner" on which I created an index with btree method. The table contains around 3k rows.

Now I run it using EXPLAIN command.

This query has some results:

explain SELECT "Name" FROM test WHERE "Owner"='root'

"Seq Scan on test  (cost=0.00..119.11 rows=263 width=11)"
"  Filter: (("Owner")::text = 'root'::text)"

Query without results:

explain SELECT "Name" FROM test WHERE "Owner"='blah'

"Index Scan using idx_test_owner on test  (cost=0.00..96.56 rows=28 width=11)"
"  Index Cond: (("Owner")::text = 'blah'::text)"

Why is this happening? Is it because of the memory? I'm running on default db settings, version 8.0 and SUSE 10.

Thanks for help, Sebastjan


pgsql-general by date:

Previous
From: Florent Garcin
Date:
Subject: constraint on type object in oracle
Next
From: "A. Kretschmer"
Date:
Subject: Re: Autocommit in Fedora 3