pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Own opclass and LIKE problem again!
2+ messages / 2 participants
[nested] [flat]

* Own opclass and LIKE problem again!
@ 2004-04-26 10:07 Antal Attila <antal.attila@ritek.hu>
  0 siblings, 0 replies; 2+ messages in thread

From: Antal Attila @ 2004-04-26 10:07 UTC (permalink / raw)
  To: pgsql-sql

Hi!

Thank you very much the answers for my previous 'Multi ordered select
and indexing' question!
I tried your suggestions, and those are working well. We found a problem
when used '(-col2)' instead of 'col2 DESC'. This solution working as a
functional index and in our experience when the planner evaluates the
cost of using this functional index, it uses 0.5% of the table's size.
Usually this estimate is bad, and the query is slow. Why is it working
such? Preferably should I ask this on the HACKERS or PERFORMANCE list?

But my main question how can I force the LIKE operator for using my own
operator class. I can create own LIKE operator, but it won't use my
reverse order operator class (and its indexes). How can I exchange the
standard LIKE operator with my own, which use my special reverse order
indexes?

For examle: (~~ means LIKE)
  col ~~ 'asd%'   working as  ((col >= 'asd'::text) AND (col <
'ase'::text))
I'd like to see the next:
  col /~~ 'asd%'    working as  ((col />= 'asd'::text) AND (col /<
'ase'::text))

Can somebody help us?

Thanks in advance.
Antal Attila





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Own opclass and LIKE problem again!
@ 2004-04-26 10:11 Atesz <atesz@ritek.hu>
  0 siblings, 0 replies; 2+ messages in thread

From: Atesz @ 2004-04-26 10:11 UTC (permalink / raw)
  To: pgsql-sql

Hi!

Thank you very much the answers for my previous 'Multi ordered select
and indexing' question! I tried your suggestions, and those are working
well. We found a problem when used '(-col2)' instead of 'col2 DESC'.
This solution working as a functional index and in our experience when
the planner evaluates the cost of using this functional index, it uses
0.5% of the table's size. Usually this estimate is bad, and the query is
slow. Why is it working such? Preferably should I ask this on the
HACKERS or PERFORMANCE list?

But my main question how can I force the LIKE operator for using my own
operator class. I can create own LIKE operator, but it won't use my
reverse order operator class (and its indexes). How can I exchange the
standard LIKE operator with my own, which use my special reverse order
indexes?

For examle: (~~ means LIKE)
  col ~~ 'asd%'   working as  ((col >= 'asd'::text) AND (col <
'ase'::text))
I'd like to see the next:
  col /~~ 'asd%'    working as  ((col />= 'asd'::text) AND (col /<
'ase'::text))

Can somebody help us?

Thanks in advance.
Antal Attila





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-04-26 10:11 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-04-26 10:07 Own opclass and LIKE problem again! Antal Attila <antal.attila@ritek.hu>
2004-04-26 10:11 Own opclass and LIKE problem again! Atesz <atesz@ritek.hu>

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