Re: inet regression test

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: inet regression test
Date: 2003-01-15 20:19:25
Message-ID: 1042661964.61110.38.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

regression=#
regression=#
regression=# create index inet_idx1 on inet_tbl(i);
CREATE INDEX
regression=# set enable_seqscan to off;
SET
regression=# explain select * from inet_tbl where
i<<'192.168.1.0/24'::cidr;
QUERY
PLAN
-------------------------------------------------------------------------------
Index Scan using inet_idx1 on inet_tbl (cost=0.00..4.68 rows=7
width=64)
Index Cond: ((i > '192.168.1.0/24'::inet) AND (i <=
'192.168.1.255'::inet))
Filter: (i << '192.168.1.0/24'::inet)
(3 rows)

regression=# select * from inet_tbl where i<<'192.168.1.0/24'::cidr;
c | i
----------------+------------------
192.168.1.0/24 | 192.168.1.0/25
192.168.1.0/24 | 192.168.1.255/25
192.168.1.0/24 | 192.168.1.226
(3 rows)

On Wed, 2003-01-15 at 14:58, Tom Lane wrote:
> Rod Taylor <rbt(at)rbt(dot)ca> writes:
> > Looks like some ORDER BY statements would be useful.
>
> To do what? Those queries should already be producing indexscan plans.
> If you're not getting the expected answers, there is something that
> needs to be fixed, not papered over.
>
> Please try
>
> create index inet_idx1 on inet_tbl(i);
> set enable_seqscan to off;
> explain select * from inet_tbl where i<<'192.168.1.0/24'::cidr;
>
> regards, tom lane
--
Rod Taylor <rbt(at)rbt(dot)ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-01-15 20:22:43 Re: inet regression test
Previous Message Bruce Momjian 2003-01-15 20:00:00 Re: inet regression test