Re: Question: consolidating strpos searches?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



James Addison <jay@xxxxxxxxxxxxxx> 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





[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux