Re: index on a box

From: Dustin Sallings <dustin+postgres(at)spy(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: index on a box
Date: 2001-06-21 22:22:42
Message-ID: Pine.OSX.4.33.0106211518500.396-100000@dustinmobile
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Around 15:14 on Jun 21, 2001, Dustin Sallings said:

# select * from tmp where box(point(-121,37),point(-121,37)) @ b;
#
# Index Scan using tmp_bybox on tmp (cost=0.00..238.59 rows=61 width=92)

Ugh, any idea here?

create function box(point) returns box as
'select box($1, $1)'
language 'sql';

misc=# explain select * from tmp where box(point(-121, 37)) @ b;
NOTICE: QUERY PLAN:

Seq Scan on tmp (cost=0.00..2653.01 rows=61 width=92)

misc=# explain select * from tmp
misc-# where box(point(-121,37),point(-121,37)) @ b;
NOTICE: QUERY PLAN:

Index Scan using tmp_bybox on tmp (cost=0.00..238.59 rows=61 width=92)

misc=# select box(point(-121, 37));
box
---------------------
(-121,37),(-121,37)

misc=# select box(point(-121,37),point(-121,37));
box
---------------------
(-121,37),(-121,37)

misc=# select 1 where box(point(-121,37),point(-121,37))=box(point(-121,
37));
?column?
----------
1

--
SPY My girlfriend asked me which one I like better.
pub 1024/3CAE01D5 1994/11/03 Dustin Sallings <dustin(at)spy(dot)net>
| Key fingerprint = 87 02 57 08 02 D0 DA D6 C8 0F 3E 65 51 98 D8 BE
L_______________________ I hope the answer won't upset her. ____________

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-06-21 22:26:19 Re: index on a box
Previous Message Dustin Sallings 2001-06-21 22:14:54 Re: index on a box