Skip site navigation (1) Skip section navigation (2)

Re: Newbie Developer Question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Matthew Campbell" <mtthw(dot)cmpbll(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Newbie Developer Question
Date: 2007-02-01 17:57:46
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
"Matthew Campbell" <mtthw(dot)cmpbll(at)gmail(dot)com> writes:
> hashbeginscan looks like it sets up a scan and returns it, but it takes the
> number of keys and the array of scan keys.  Where do we get these arguments
> from?

You should probably go read the btree code for awhile to see how it's
done there.  The btree insertion code manufactures some scan keys from
the index tuple given to be inserted, which is what it uses to locate
the correct insertion point in the index (and, hence, any potential
conflicting entries).  But actually I'm not sure that you care about
that for hash --- all you really need is to know which bucket to look
in, and IIRC the hash insertion code calculates that already without
bothering with making scankeys.

			regards, tom lane

In response to

pgsql-novice by date

Next:From: joe speigleDate: 2007-02-01 18:04:02
Subject: fetch cursor into id, set_values .... -> problem
Previous:From: Sean DavisDate: 2007-02-01 17:33:31
Subject: Re: query efficiency - Can I speed it up?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group