Re: GiST -- making my index faster makes is slower

From: David Blasby <dblasby(at)refractions(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: GiST -- making my index faster makes is slower
Date: 2004-04-16 22:51:07
Message-ID: 4080635B.8070203@refractions.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Kirkwood 2004-04-16 23:04:54 Re: PostgreSQL configuration
Previous Message Manfred Koizar 2004-04-16 22:26:22 Re: query slows down with more accurate stats