Re: Question: consolidating strpos searches? - Mailing list pgsql-performance

From Tom Lane
Subject Re: Question: consolidating strpos searches?
Date
Msg-id 634658.1736012711@sss.pgh.pa.us
Whole thread Raw
List pgsql-performance
James Addison <jay@jp-hosting.net> writes:
> In other words: each additional strpos(value, ...) expression
> increased the evaluation time by a similar, significant duration of
> two seconds.  This seems to confirm the basis that each expression is
> currently evaluated separately, by an independent read from the input
> text.

That's correct.  We have not felt a need to try to identify duplicate
function calls: the cost of looking for them would seldom be repaid,
so that such an optimization would be a net loss for most people.
(In your example, they're not even truly duplicates.)

> I'd like to suggest the introduction of a documented multiple string
> matching algorithm[1], to yield results for each of multiple strpos
> calls while only reading through their common input text at-most once.

This seems like something with a pretty narrow audience.  I'd suggest
building it as an extension rather than trying to persuade people
it belongs in core Postgres.

            regards, tom lane



pgsql-performance by date:

Previous
From: shammat@gmx.net
Date:
Subject: Re: Reg. Postgres Unique contraint
Next
From: Greg Sabino Mullane
Date:
Subject: Re: Question: consolidating strpos searches?