pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedRe: How to make operator class?
3+ messages / 3 participants
[nested] [flat]
* Re: How to make operator class?
@ 2001-02-10 16:38 Tom Lane <tgl@sss.pgh.pa.us>
parent: Kim Yunhan <spbear@hanmail.net>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2001-02-10 16:38 UTC (permalink / raw)
To: Kim Yunhan <spbear@hanmail.net>; +Cc: pgsql-sql
"Kim Yunhan" <spbear@hanmail.net> writes:
> then, how to make operator class?
See the Programmer's Guide, particularly
http://www.postgresql.org/devel-corner/docs/postgres/xindex.htm
If this is a followup to your previous question about making a
reverse-order index, you'll need to start by making a support function
that delivers the reverse (negative) of what the existing btree
comparison function for the datatype does (see btint4cmp and friends).
The remaining operators to comprise the opclass are the same ones that
exist already, you just need to swap their positions (use '<' for '>'
etc). Good luck!
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: How to make operator class?
@ 2001-02-10 18:03 Josh Berkus <josh@agliodbs.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: Josh Berkus @ 2001-02-10 18:03 UTC (permalink / raw)
To: pgsql-sql
Tom,
> > Hmmm .... thinking about it logically, shouldn't the database engine be
> > able to use an index on a single column either backwards or forwards?
>
> Sure, but he wanted a sort with the first column in ascending order and
> the second in descending order. You can't get that by scanning an index
> that has both columns in the same order...
Aha. I see the problem. My approach would be to use two seperate
indexes, but maybe that's not sophisticated enough :-)
And, Tom, you're working too hard again. It's Saturday. Go home.
-Josh Berkus (Who is home, just VPN'ing into my office).
--
______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh@agliodbs.com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco
^ permalink raw reply [nested|flat] 3+ messages in thread
* How to make operator class?
@ 2001-02-10 18:59 Kim Yunhan <spbear@hanmail.net>
0 siblings, 1 reply; 3+ messages in thread
From: Kim Yunhan @ 2001-02-10 18:59 UTC (permalink / raw)
To: pgsql-sql
when create indexes, use operator class like this.
CREATE INDEX idx_name ON tbl_name (col_name [operator class]);
so, i made an operator.
but i think that it is different operator class because operator class doesn't work at all.
then, how to make operator class?
==================================================
==================================================
¿ì¸® ÀÎÅͳÝ, Daum
Æò»ý ¾²´Â ¹«·á E-mail ÁÖ¼Ò ÇѸÞÀϳÝ
Áö±¸ÃÌ ÇÑ±Û °Ë»ö¼ºñ½º Daum FIREBALL
http://www.daum.net
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2001-02-10 18:59 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-02-10 18:59 How to make operator class? Kim Yunhan <spbear@hanmail.net>
2001-02-10 16:38 ` Tom Lane <tgl@sss.pgh.pa.us>
2001-02-10 18:03 ` Josh Berkus <josh@agliodbs.com>
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