>
> Moin! (* ignore, it's a german greeting phrase *)
>
> Hi!
>
> On Fri, 29 Jan 1999 14:51:29 +0100 (MET)
> Remigiusz Sokolowski <rems@gdansk.sprint.pl> wrote:
> [snipped]
> > Right, but I suppose, that var1 and var2 and var3 are only examples - it
> > could be that it would be 'chicks', 'flames' and 'tails' - what about
> > this? :-)
>
> You're right.
> But I wouldn't make it into different OR clauses. If the select joins
> tables, I guess the ORs will decrease the performance due to multiple
> evaluations of the join.
>
> This could be circumvented by putting the patterns in the regex.
>
> Example:
> where (relname ~* 'pg_class') OR (relname ~* 'pg_attribute')
> will be converted to:
> where relname ~* 'pg_class|pg_attribute'
>
> So, only one regex-match ist performed and no difficulties with
> multiple OR clauses will arise.
>
> Comments?
>
This, what I here write is only my supposition. I'm not aware of how
Postgres optimizes its queries, but I have some expierience with oyher
databases - AFAIK usually optimizer makes optimization for simple
construction of queries - for example with OR or AND clauses - in cases
much more complicated structures it could be just slower.
I want here only present my point of view - in this case I could be wrong,
cause have not too much time used postgres...
Rem
p.s.
may be somebody more expierienced give me a hint, where to find something
about optimization of queries in Postgres?
-------------------------------------------------------------------*------------
Remigiusz Sokolowski e-mail: rems@gdansk.sprint.pl * *
-----------------------------------------------------------------*****----------