From: Tom Lane <tgl@sss.pgh.pa.us>
To: haddock@mail.ru
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #8117: simple but huge query infinite execution time
Date: Thu, 25 Apr 2013 11:12:53 -0400
Message-ID: <24342.1366902773@sss.pgh.pa.us> (raw)
In-Reply-To: <E1UVNJe-0004v7-MU@wrigleys.postgresql.org>
References: <E1UVNJe-0004v7-MU@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
haddock@mail.ru writes:
> query has the following scheme
> SELECT
> regexp_matches('...',' (\d+)\:','g'),
> regexp_matches('...','\:([\d\.]+)','g')
I'm not sure what you're expecting this to do, but what it will actually
do is produce a number of rows equal to the least common multiple of the
periods of the two set-returning functions. In this example it seems
the first call produces 2510 rows and the second 2507 rows. Those
numbers have no factors in common, so you get 6292570 rows, the same as
if you'd written "select * from regexp_matches(...), regexp_matches(...)".
In short, I see no bug here. The behavior of queries with multiple SRFs
in the same targetlist is a bit dubious, but we're not going to change
it, except perhaps by deprecating such usages altogether.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, haddock@mail.ru
Subject: Re: BUG #8117: simple but huge query infinite execution time
In-Reply-To: <24342.1366902773@sss.pgh.pa.us>
References: <E1UVNJe-0004v7-MU@wrigleys.postgresql.org> <24342.1366902773@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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