ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/bioseg/trunk/README.bioseg
(Generate patch)
# Line 20 | Line 20
20   INSTALLATION
21   ============
22  
23 < Change into the contrib directory in PostgreSQL and unpack the bioseg tar
24 < file:
23 > Change into the contrib directory in the PostgreSQL source and unpack the
24 > bioseg tar file:
25      gzip -d < bioseg-x.y.tar.gz | tar xf -
26  
27   (Or check-out from subversion with:
# Line 141 | Line 141
141          The segment [a, b] is contained in [c, d], that is,
142          a >= c and b <= d
143  
144 Although the mnemonics of the following operators is questionable, I
145 preserved them to maintain visual consistency with other geometric
146 data types defined in PostgreSQL.
147
144   Other operators:
145  
146   [a, b] < [c, d]         Less than
# Line 157 | Line 153
153          you want to use ORDER BY with this type
154  
155  
156 < NOTE: The performance of an R-tree index can largely depend on the
157 < order of input values. It may be very helpful to sort the input table
162 < on the BIOSEG column (see the script sort-segments.pl for an example)
156 > NOTE: The performance of an R-tree index can largely depend on the order of
157 > input values.  It may be helpful to sort the input table on the BIOSEG column.
158  
159  
160   INDEXES
# Line 171 | Line 166
166    CREATE TABLE tt (range bioseg, id integer);
167    CREATE INDEX tt_range_idx ON tt USING gist (range);
168  
169 + Or for an existing table a function index can be used.  For example on a
170 + feature table with fmin and fmax:
171 +
172 +  CREATE INDEX bioseg_index ON feature USING gist (bioseg_create(fmin, fmax));
173 +
174 + This query will then find features that overlap 2000..3000, using the index:
175 +
176 +  SELECT * FROM feature
177 +           WHERE '2000..3000'::bioseg && bioseg_create(fmin, fmax);
178 +
179  
180   INTERBASE COORDINATES
181   =====================

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines