<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>This looks odd. Here is what pgAdmin tells me if is the current
      definition of st_setsrid (cost of 1.0)<br>
    </p>
    <p><br>
    </p>
    <p>CREATE OR REPLACE FUNCTION public.st_setsrid(<br>
          geog geography,<br>
          srid integer)<br>
          RETURNS geography<br>
          LANGUAGE 'c'<br>
          COST 1.0<br>
          IMMUTABLE NOT LEAKPROOF STRICT <br>
      AS '$libdir/postgis-2.3', 'LWGEOM_set_srid'<br>
      ;<br>
    </p>
    <p>However using you new definition still seems to have fixed the
      issue.</p>
    <p><br>
    </p>
    <p>Anyway,</p>
    <p><br>
    </p>
    <p>thanks</p>
    <p><br>
    </p>
    <p>Bill<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 4/12/2016 10:19 AM, Regina Obe
      wrote:<br>
    </div>
    <blockquote cite="mid:000b01d24dbb$a66314a0$f3293de0$@pcorp.us"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Consolas",serif;
        color:black;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Tracked
            it down.  It's caused by the cost changes we made in 2.3. 
            So it affects 9.5 running 2.3 as well.<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">I've
            committed one part which would fix your particular problem.<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">The
            fix, change the cost on ST_SetSRID from 10 to 1 as follows
            and that should fix this particular issue.  There are other
            functions commonly used this way that we have to patch.<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">CREATE
            OR REPLACE FUNCTION st_setsrid(<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">   
            geometry,<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">   
            integer)<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> 
            RETURNS geometry AS<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">'$libdir/postgis-2.3',
            'LWGEOM_set_srid'<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> 
            LANGUAGE c IMMUTABLE STRICT PARALLEL SAFE<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> 
            COST 1;<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal" style="margin-left:.5in"><b><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">From:</span></b><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">
                postgis-users
                [<a class="moz-txt-link-freetext" href="mailto:postgis-users-bounces@lists.osgeo.org">mailto:postgis-users-bounces@lists.osgeo.org</a>] <b>On
                  Behalf Of </b>Bill Measday<br>
                <b>Sent:</b> Saturday, December 03, 2016 3:41 PM<br>
                <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
                <b>Subject:</b> Re: [postgis-users] Substantial
                different index use between 9.5 and 9.6 using Postgis<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
        <p style="margin-left:.5in">Thanks Regina - nice to know it
          wasn't just my incompetence!.<o:p></o:p></p>
        <p style="margin-left:.5in">Good luck tracking down the root
          cause.<o:p></o:p></p>
        <p style="margin-left:.5in"><br>
          Rgds<o:p></o:p></p>
        <p style="margin-left:.5in"><br>
          Bill<o:p></o:p></p>
        <p style="margin-left:.5in"><o:p> </o:p></p>
        <p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
        <div>
          <p class="MsoNormal" style="margin-left:.5in">On 4/12/2016
            6:53 AM, Regina Obe wrote:<o:p></o:p></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal" style="margin-left:1.0in"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">For
              reference I have ticketed this as:</span><o:p></o:p></p>
          <p class="MsoNormal" style="margin-left:1.0in"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><o:p></o:p></p>
          <p class="MsoNormal" style="margin-left:1.0in"><span
              style="font-size:11.0pt;font-family:"Calibri",sans-serif"><a
                moz-do-not-send="true"
                href="https://trac.osgeo.org/postgis/ticket/3675">https://trac.osgeo.org/postgis/ticket/3675</a></span><o:p></o:p></p>
          <p class="MsoNormal" style="margin-left:1.0in"><span
              style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><o:p></o:p></p>
          <p class="MsoNormal" style="margin-left:1.0in"> <o:p></o:p></p>
          <div>
            <p class="MsoNormal" style="margin-left:1.0in"> <o:p></o:p></p>
            <div>
              <p class="MsoNormal"
style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:1.0in">----------
                message ----------<br>
                <br>
                <br>
                <br>
                Bill,<br>
                <br>
                Never mind. Thanks to Brian Hamlin's nudging on IRC that
                he sees the issue<br>
                too, I was able to replicate it.<br>
                <br>
                <br>
                I think the reason I missed it in my testing is that it
                doesn't happen with<br>
                the more common cases of:<br>
                <br>
                SELECT e.gid<br>
                FROM e1 , e2<br>
                WHERE ST_Intersects(e1.geom, e2.geom);<br>
                <br>
                Or where you use constants in ST_MakePoint like your
                example<br>
                <br>
                <br>
                But only in case where you have:<br>
                <br>
                SELECT e.gid<br>
                FROM e1 , e2<br>
                WHERE ST_Intersects(e1.geom,
                ST_SetSRID(ST_MakePoint(e2.longitude,<br>
                e2.latitude),4326)  );<br>
                <br>
                <br>
                So I'll go ahead and ticket it and try to track down the
                root cause.  I<br>
                suspect it affects all our relation functions.<br>
                <br>
                Thanks for bringing to our attention,<br>
                <br>
                Regina<br>
                <a moz-do-not-send="true" href="http://www.postgis.us"
                  target="_blank">http://www.postgis.us</a><br>
                <a moz-do-not-send="true" href="http://postgis.net"
                  target="_blank">http://postgis.net</a><br>
                <br>
                <br>
                <br>
                <o:p></o:p></p>
            </div>
            <p class="MsoNormal" style="margin-left:1.0in"> <o:p></o:p></p>
          </div>
          <p class="MsoNormal" style="margin-left:.5in"><br>
            <br>
            <br>
            <o:p></o:p></p>
          <pre style="margin-left:.5in">_______________________________________________<o:p></o:p></pre>
          <pre style="margin-left:.5in">postgis-users mailing list<o:p></o:p></pre>
          <pre style="margin-left:.5in"><a moz-do-not-send="true" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><o:p></o:p></pre>
          <pre style="margin-left:.5in"><a moz-do-not-send="true" href="http://lists.osgeo.org/mailman/listinfo/postgis-users">http://lists.osgeo.org/mailman/listinfo/postgis-users</a><o:p></o:p></pre>
        </blockquote>
        <p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/postgis-users">http://lists.osgeo.org/mailman/listinfo/postgis-users</a></pre>
    </blockquote>
    <br>
  </body>
</html>