Re: [QUESTION/PROPOSAL] loose quadtree in spgist - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [QUESTION/PROPOSAL] loose quadtree in spgist
Date
Msg-id 25932.1578514054@sss.pgh.pa.us
Whole thread Raw
In response to Re: [QUESTION/PROPOSAL] loose quadtree in spgist  (Peter Griggs <petergriggs33@gmail.com>)
Responses Re: [QUESTION/PROPOSAL] loose quadtree in spgist  (Peter Griggs <petergriggs33@gmail.com>)
List pgsql-hackers
Peter Griggs <petergriggs33@gmail.com> writes:
> In the getQuadrant function in the file src/backend/utils/adt/geo_spgist.c,
> I only added some elog statements to see the quadrant that a box is placed
> into using the current code. getQuadrant is called several times by the
> spg_box_quad_picksplit function, which is used when inserting into the
> quadtree. With this change, I can still build postgres but when I try to
> trigger the code, nothing gets printed to my logfile.

Perhaps you're looking in the wrong logfile.  elog(LOG) should definitely
produce output unless you're using very strange settings.

Another possibility is that the specific test case you're using doesn't
actually reach this function.  I'm not totally sure, but I think that
SPGiST might not call the datatype-specific choose or picksplit functions
until it's got more than one index page's worth of data.

>     elog(LOG, "BOX (minx, miny) = (%d, %d)\n", centroid->low.x, centroid->low.y);

A couple thoughts here:

* From memory, the x and y values of a BOX are float8, so don't you want
to use %g or %f instead of %d?

* You don't want to end an elog with \n, that'll just add extra blank
lines to the log.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: our checks for read-only queries are not great
Next
From: Robert Haas
Date:
Subject: Re: our checks for read-only queries are not great