Re: GiST -- making my index faster makes is slower - Mailing list pgsql-hackers

From David Blasby
Subject Re: GiST -- making my index faster makes is slower
Date
Msg-id 4080635B.8070203@refractions.net
Whole thread Raw
In response to Re: GiST -- making my index faster makes is slower  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: GiST -- making my index faster makes is slower
List pgsql-hackers
Humm -- strange results here:


typedef struct
{float xmin;float ymin;float xmax;float ymax;
} BOX2DFLOAT4;

This takes about 18,000 ms to do a nested query with 10,000 iterations.

typedef struct
{float xmin;float ymin;float xmax;float ymax;char  junk[16];
} BOX2DFLOAT4;

This takes about 15,000 ms to do a nested query with 10,000 iterations.


typedef struct
{double xmin;double ymin;double xmax;double ymax;
} BOX2DFLOAT4;

This takes about 1500 ms to do a nested query with 10,000 iterations.
Yes - that almost 14 seconds faster!

This doesnt make a lot of sense since the only part of the GiST index 
thats being called that actually looks at the bounding boxes is this:

 retval = (((key->xmax>= query->xmax) &&          (key->xmin <= query->xmax)) ||          ((query->xmax>= key->xmax) &&
        (query->xmin<= key->xmax)))             &&          (((key->ymax>= query->ymax) &&          (key->ymin<=
query->ymax))||          ((query->ymax>= key->ymax) &&          (query->ymin<= key->ymax)));
 

dave


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: GiST -- making my index faster makes is slower
Next
From: Mark Kirkwood
Date:
Subject: Re: PostgreSQL configuration