Re: performance of implicit join vs. explicit conditions on inet queries? - Mailing list pgsql-performance

From Tom Lane
Subject Re: performance of implicit join vs. explicit conditions on inet queries?
Date
Msg-id 1207.1130905252@sss.pgh.pa.us
Whole thread Raw
In response to Re: performance of implicit join vs. explicit conditions on inet queries?  ("Qingqing Zhou" <zhouqq@cs.toronto.edu>)
List pgsql-performance
"Qingqing Zhou" <zhouqq@cs.toronto.edu> writes:
> "Tom Lane" <tgl@sss.pgh.pa.us> wrote
>> No, that's completely irrelevant to his problem.  The reason we can't do
>> this is that the transformation from "x << const" to a range check on x
>> is a plan-time transformation; there's no mechanism in place to do it
>> at runtime.

> Not quite understand, sorry ...

> (1) For this query (in an as-is PG syntax, which find out all rectangles lie
> in a given rectangle) :

> SELECT r FROM all_rectangles
>   WHERE r << rectangle('(1,9),(9,1)');

No, you're thinking of the wrong << operator.  The question was about
the inet network inclusion operator.  We have a special case in
indxpath.c to transform "inetcol << inetconstant" into a range check
on the inet variable, much like we can transform a left-anchored LIKE
pattern into a range check on the text variable.

            regards, tom lane

pgsql-performance by date:

Previous
From: "Qingqing Zhou"
Date:
Subject: Re: performance of implicit join vs. explicit conditions on inet queries?
Next
From: "PostgreSQL"
Date:
Subject: Re: 8.1beta3 performance