Thread: index not scanned

index not scanned

From
"Ben-Nes Michael"
Date:
Hi

I add an Index to table that have only 30 rows.

CREATE INDEX copy_of_forum_l_c_f_id_idx ON copy_of_forum_list_child ( f_id,
father_name );

when i do:
EXPLAIN SELECT * FROM copy_of_forum_list_child WHERE f_id = 1 and
father_name = 'top';

its return: Seq Scan on copy_of_forum_list_child  (cost=0.00..2.44 rows=1
width=100)

why its not scanning the index ?

does the planner knows that the table is small and it will take more time to
check the index then stright check ?

by the way, the table will get quite big in the future.

Cheers


Re: index not scanned

From
Martijn van Oosterhout
Date:
On Sun, Oct 27, 2002 at 12:46:39PM +0200, Ben-Nes Michael wrote:
> Hi
>
> I add an Index to table that have only 30 rows.

...

> does the planner knows that the table is small and it will take more time to
> check the index then stright check ?

Yes.

> by the way, the table will get quite big in the future.

So add a few thousand more rows and try again. Don't forget to ANALYZE.
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.

Attachment