Indexes works only on miss

From: Sebastjan Trepca <trepca(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Indexes works only on miss
Date: 2006-01-06 16:42:41
Message-ID: cd329af80601060842h436fbf44q58ed99458053baf@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2006-01-06 16:45:57 Re: Autocommit in Fedora 3
Previous Message John Meyer 2006-01-06 16:37:58 Re: constraint on type object in oracle