Re: B+ versus hash maps

From: Jim Nasby <jnasby(at)pervasive(dot)com>
To: surabhi(dot)ahuja <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)in>
Cc: "Michael Fuhr" <mike(at)fuhr(dot)org>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: B+ versus hash maps
Date: 2006-06-15 20:19:54
Message-ID: 3A3631F2-86C9-43D5-BBC1-9D2E797B8CA6@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Jun 15, 2006, at 8:07 AM, surabhi.ahuja wrote:

> is there any way of specifying wht type of index i want, say hash
> maps instead of the B+ trees.
> someone told me that in the case where duplicates occur(on the
> indexed field), hash map are better than B+ trees.

http://www.postgresql.org/docs/8.1/interactive/sql-createindex.html

> and also please tell if i can assume that it will use index only
> and not go for sequential scan,
> again i was told for that i ll have to set the random page cost
> parameter to 1.

The database will use whatever it thinks is optimal. Use explain
analyze to see what it's doing.

Unless your database fits (and stays) entirely in memory, you'll
probably be pretty unhappy with random_page_cost=1.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim Nasby 2006-06-15 20:21:29 Re: Annoying "could not find a "psql" to execute" message
Previous Message Shoaib Mir 2006-06-15 20:18:32 Re: query optimizer