From: Kaloyan Iliev <kaloyan@mbox.digsys.bg>
To: pgsql-performance@postgresql.org
Subject: Re: Query not using index
Date: Fri, 09 Dec 2005 18:38:42 +0200
Message-ID: <4399B312.2080907@mbox.digsys.bg> (raw)
In-Reply-To: <4399500A.4020607@faith.digsys.bg>
References: <4399500A.4020607@faith.digsys.bg>
Hi all,
Thanks for the reply. I made some more test and find out that the
problem is with the <<= operator for the network type. Can I create
index which to work with <<=. Because if I use = the index is used. But
not for <<=.
iplog=# explain analyze SELECT *
iplog-# FROM croute
iplog-# WHERE '193.68.0.10/32' <<=
network;
QUERY PLAN
---------------------------------------------------------------------------------------------------------
Seq Scan on croute (cost=0.00..707.27 rows=4891 width=103) (actual
time=10.313..29.621 rows=2 loops=1)
Filter: ('193.68.0.10/32'::cidr <<= network)
Total runtime: 29.729 ms
(3 rows)
iplog=# explain analyze SELECT *
iplog-# FROM croute
iplog-# WHERE '193.68.0.10/32' = network;
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------
Index Scan using croute_network_all on croute (cost=0.00..17.99 rows=4
width=103) (actual time=0.053..0.059 rows=1 loops=1)
Index Cond: ('193.68.0.10/32'::cidr = network)
Total runtime: 0.167 ms
(3 rows)
Waiting for replies.
Thanks to all in advance.
Kaloyan Iliev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: kaloyan@mbox.digsys.bg
Subject: Re: Query not using index
In-Reply-To: <4399B312.2080907@mbox.digsys.bg>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox