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
---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match