Re: Fix quadratic performance of regexp match/split functions

From: Kaiting Chen <ktchen14(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Subject: Re: Fix quadratic performance of regexp match/split functions
Date: 2018-08-16 03:41:01
Message-ID: 153439086187.1388.4636958239048294213.pgcf@coridan.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Applied cleanly for me. Here are my performance test results:

count
---------
3000000
(1 row)

Time: 3167.836 ms (00:03.168)
count
----------
10100000
(1 row)

Time: 6074.369 ms (00:06.074)
count
-------
10001
(1 row)

Time: 8.159 ms

The performance improves substantially in case 2 as advertised:

count
---------
3000000
(1 row)

Time: 3387.612 ms (00:03.388)
count
----------
10100000
(1 row)

Time: 43794.224 ms (00:43.794)
count
-------
10001
(1 row)

Time: 1436.587 ms (00:01.437)

I'll do some more testing to determine how this behaves in the presence of multibyte characters in UTF-8.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-08-16 03:43:32 Re: Update comment in errcodes.txt correctly
Previous Message Etsuro Fujita 2018-08-16 03:00:16 Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.