CIDR index use for '<<' operator

Поиск
Список
Период
Сортировка
От Kendall Koning
Тема CIDR index use for '<<' operator
Дата
Msg-id 002101c02e5d$b59263c0$4d00a8c0@kkoning
обсуждение исходный текст
Ответы Re: CIDR index use for '<<' operator  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Postgres doesn't seem to make use of indexes when doing operations with the
CIDR '<<' (contains) operator.  Is this intended behavior or impossible for
some reason?


test=> \d a
          Table "a"
 Attribute | Type | Modifier
-----------+------+----------
 a         | cidr | not null
Index: a_pkey

test=> EXPLAIN SELECT * FROM a WHERE a.a = '192.168.0.128/32'::cidr;
NOTICE:  QUERY PLAN:

Index Scan using a_pkey on a  (cost=0.00..2.16 rows=1 width=12)

EXPLAIN
test=> EXPLAIN SELECT * FROM a WHERE a.a << '192.168.0.128/30'::cidr;
NOTICE:  QUERY PLAN:

Seq Scan on a  (cost=0.00..1205.20 rows=32768 width=12)

EXPLAIN
test=>


--
Kendall Koning
Senior Network Engineer, egl.net
Ph: (616) 392-9949 x26


В списке pgsql-general по дате отправления:

Предыдущее
От: oberpwd@anubis.network.com (Wade D. Oberpriller)
Дата:
Сообщение: executing user-defined functions
Следующее
От: Nina Kuznetsova
Дата:
Сообщение: undefined reference