<div dir="ltr">On Sun, Sep 15, 2013 at 1:26 AM, Paul Ramsey <span dir="ltr"><<a href="mailto:pramsey@cleverelephant.ca" target="_blank">pramsey@cleverelephant.ca</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">We talked about invalid keys, and we're going to need some. I'm going to have to backtrack and remember where/when we did this last time. Basically any instance of GEOMETRY EMPTY, or a geometry with NaN coordinates, or Inf coordinates, should generate an invalid key (is there any way to just leave it out of the index, since that's effectively what we want anyways...)</blockquote>
<div><br></div><div>General idea is that index scan must give same results as sequential scan.</div><div><br></div><div>Generally there are 3 cases: inf coordinates, nan coordinates, lower bound greater than upper bound.</div>
<div>Let's consider them:</div><div>1) inf coordinates</div><div>I don't understand why you're so against inf coordinates. For example, box with infinite upper bound is legal geometrical object. Probably, there are some use cases where infinite bounds are useful. However, if you would like to prohibit results of index scans with infinite bounds, you should corrects operators itself first. Otherwise, it would be inconsistent behaviour. The only index operator is &&&. So it wouldn't be hard to make index scans and sequential scans consistent themselves. </div>
<div>2) NaN coordinates</div><div>Any single NaN coordinate makes &&& operator always return false. So, in this case you can do whatever: leave box3df as is or replace it with all NaNs.</div><div>3) lower bound is greater than upper bound</div>
<div>I wonder how it could be possible. Bug in lwgeom? If it could be caused only by bug then I think trigger an error is proper solution for this case. </div><div><br></div><div>------<br>With best regards,<br>Alexander Korotkov. <br>
</div></div><br></div></div>