hash.3 (32eef9aeb1f39a1623cea55da147c89abbd5b9a5) hash.3 (2efeeba554cbd7bdee9cfe17641c8bd335c7972f)
1.\" Copyright (c) 1990, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 63 unchanged lines hidden (view full) ---

72 u_int32_t (*hash)(const void *, size_t);
73 int lorder;
74} HASHINFO;
75.Ed
76.Pp
77The elements of this structure are as follows:
78.Bl -tag -width indent
79.It Va bsize
1.\" Copyright (c) 1990, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 63 unchanged lines hidden (view full) ---

72 u_int32_t (*hash)(const void *, size_t);
73 int lorder;
74} HASHINFO;
75.Ed
76.Pp
77The elements of this structure are as follows:
78.Bl -tag -width indent
79.It Va bsize
80.Va Bsize
80The
81.Va bsize
82element
81defines the
82.Nm
83table bucket size, and is, by default, 256 bytes.
84It may be preferable to increase the page size for disk-resident tables
85and tables with large data items.
86.It Va ffactor
83defines the
84.Nm
85table bucket size, and is, by default, 256 bytes.
86It may be preferable to increase the page size for disk-resident tables
87and tables with large data items.
88.It Va ffactor
87.Va Ffactor
89The
90.Va ffactor
91element
88indicates a desired density within the
89.Nm
90table.
91It is an approximation of the number of keys allowed to accumulate in any
92one bucket, determining when the
93.Nm
94table grows or shrinks.
95The default value is 8.
96.It Va nelem
92indicates a desired density within the
93.Nm
94table.
95It is an approximation of the number of keys allowed to accumulate in any
96one bucket, determining when the
97.Nm
98table grows or shrinks.
99The default value is 8.
100.It Va nelem
97.Va Nelem
101The
102.Va nelem
103element
98is an estimate of the final size of the
99.Nm
100table.
101If not set or set too low,
102.Nm
103tables will expand gracefully as keys
104are entered, although a slight performance degradation may be noticed.
105The default value is 1.
106.It Va cachesize
107A suggested maximum size, in bytes, of the memory cache.
108This value is
109.Em only
110advisory, and the access method will allocate more memory rather
111than fail.
112.It Va hash
104is an estimate of the final size of the
105.Nm
106table.
107If not set or set too low,
108.Nm
109tables will expand gracefully as keys
110are entered, although a slight performance degradation may be noticed.
111The default value is 1.
112.It Va cachesize
113A suggested maximum size, in bytes, of the memory cache.
114This value is
115.Em only
116advisory, and the access method will allocate more memory rather
117than fail.
118.It Va hash
113.Va Hash
119The
120.Va hash
121element
114is a user defined
115.Nm
116function.
117Since no
118.Nm
119function performs equally well on all possible data, the
120user may find that the built-in
121.Nm

--- 14 unchanged lines hidden (view full) ---

136is 0 (no order is specified) the current host order is used.
137If the file already exists, the specified value is ignored and the
138value specified when the tree was created is used.
139.El
140.Pp
141If the file already exists (and the
142.Dv O_TRUNC
143flag is not specified), the
122is a user defined
123.Nm
124function.
125Since no
126.Nm
127function performs equally well on all possible data, the
128user may find that the built-in
129.Nm

--- 14 unchanged lines hidden (view full) ---

144is 0 (no order is specified) the current host order is used.
145If the file already exists, the specified value is ignored and the
146value specified when the tree was created is used.
147.El
148.Pp
149If the file already exists (and the
150.Dv O_TRUNC
151flag is not specified), the
144values specified for the parameters
152values specified for the
145.Va bsize , ffactor , lorder
146and
147.Va nelem
153.Va bsize , ffactor , lorder
154and
155.Va nelem
156arguments
148are
149ignored and the values specified when the tree was created are used.
150.Pp
151If a
152.Nm
153function is specified,
154.Fn hash_open
155will attempt to determine if the

--- 36 unchanged lines hidden ---
157are
158ignored and the values specified when the tree was created are used.
159.Pp
160If a
161.Nm
162function is specified,
163.Fn hash_open
164will attempt to determine if the

--- 36 unchanged lines hidden ---