2014-01-19 12:10, Emre Hasegeli <emre@hasegeli.com>:
> 2014-01-19 Andreas Karlsson <andreas@proxel.se>:
>
>> I am a bit suspicious about your memcmp based optimization in bitncommon,
>> but it could be good. Have you benchmarked it compared to doing the same
>> thing with a loop?
>
> I did, when I was writing that part. I will be happy to do it again. I will
> post the results.
I was testing it by creating GiST indexes. I realized that these test are
inconsistent when BUFFERING = AUTO. I repeated them with BUFFERING = ON.
The function without memcmp was faster in this case. I will change
the function in the next version of the patch.
The test case:
Create table Network as select (a || '.' || b || '.' || c || '/24')::cidr from generate_series(0, 255) as a,
generate_series(0, 255) as b, generate_series(0, 255) as c;
Drop index if exists N;
Create index N on Network using gist(cidr) with (buffering = on);
Create table Network6 as select ('::' || to_hex(a) || ':' || to_hex(b))::inet from generate_series(0, 255) as
a, generate_series(0, 65535) as b;
Drop index if exists N6;
Create index N6 on Network6 using gist(inet) with (buffering = on);
What I could not understand is the tests with IP version 6 was much faster.
The row count is same, the index size is bigger.