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: 20012.1170352666@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

Browse pgsql-novice by date

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