Re: Newbie Developer Question - Mailing list pgsql-novice

From Tom Lane
Subject Re: Newbie Developer Question
Date
Msg-id 20012.1170352666@sss.pgh.pa.us
Whole thread Raw
In response to Re: Newbie Developer Question  ("Matthew Campbell" <mtthw.cmpbll@gmail.com>)
List pgsql-novice
"Matthew Campbell" <mtthw.cmpbll@gmail.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

pgsql-novice by date:

Previous
From: Sean Davis
Date:
Subject: Re: query efficiency - Can I speed it up?
Next
From: joe speigle
Date:
Subject: fetch cursor into id, set_values .... -> problem