5 <FirstName>Gene</FirstName>
6 <Surname>Selkov</Surname>
9 <Date>Transcribed 1998-02-19</Date>
11 <Title>GiST Indices</Title>
17 This extraction from an e-mail sent by
18 <ULink url="mailto:selkovjr@mcs.anl.gov">Eugene Selkov Jr.</ULink>
19 contains good information
20 on GiST. Hopefully we will learn more in the future and update this information.
26 Well, I can't say I quite understand what's going on, but at least
27 I (almost) succeeded in porting GiST examples to linux. The GiST access
28 method is already in the postgres tree (<FileName>src/backend/access/gist</FileName>).
31 <ULink url="ftp://s2k-ftp.cs.berkeley.edu/pub/gist/pggist/pggist.tgz">Examples at Berkeley</ULink>
32 come with an overview of the methods and demonstrate spatial index
33 mechanisms for 2D boxes, polygons, integer intervals and text
34 (see also <ULink url="http://gist.cs.berkeley.edu:8000/gist/">GiST at Berkeley</ULink>).
35 In the box example, we
36 are supposed to see a performance gain when using the GiST index; it did
37 work for me but I do not have a reasonably large collection of boxes
38 to check that. Other examples also worked, except polygons: I got an
42 test=> create index pix on polytmp using gist (p:box gist_poly_ops) with
44 ERROR: cannot open pix
46 (PostgreSQL 6.3 Sun Feb 1 14:57:30 EST 1998)
50 I could not get sense of this error message; it appears to be something
51 we'd rather ask the developers about (see also Note 4 below). What I
52 would suggest here is that someone of you linux guys (linux==gcc?) fetch the
53 original sources quoted above and apply my patch (see attachment) and
54 tell us what you feel about it. Looks cool to me, but I would not like
55 to hold it up while there are so many competent people around.
58 A few notes on the sources:
61 1. I failed to make use of the original (HPUX) Makefile and rearranged
62 the Makefile from the ancient postgres95 tutorial to do the job. I
64 to keep it generic, but I am a very poor makefile writer -- just did
65 some monkey work. Sorry about that, but I guess it is now a little
66 more portable that the original makefile.
69 2. I built the example sources right under pgsql/src (just extracted the
70 tar file there). The aforementioned Makefile assumes it is one level
71 below pgsql/src (in our case, in pgsql/src/pggist).
74 3. The changes I made to the *.c files were all about #include's,
75 function prototypes and typecasting. Other than that, I just threw
76 away a bunch of unused vars and added a couple parentheses to please
77 gcc. I hope I did not screw up too much :)
80 4. There is a comment in polyproc.sql:
83 -- -- there's a memory leak in rtree poly_ops!!
84 -- -- create index pix2 on polytmp using rtree (p poly_ops);
87 Roger that!! I thought it could be related to a number of
88 <ProductName>Postgres</ProductName> versions
89 back and tried the query. My system went nuts and I had to shoot down
90 the postmaster in about ten minutes.
94 I will continue to look into GiST for a while, but I would also
96 more examples of R-tree usage.