Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VH6uS-0003VB-HF for pgsql-performance@arkaria.postgresql.org; Wed, 04 Sep 2013 06:49:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VH6uR-0002Xy-AC for pgsql-performance@arkaria.postgresql.org; Wed, 04 Sep 2013 06:49:47 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VH6uP-0002Xp-3z for pgsql-performance@postgresql.org; Wed, 04 Sep 2013 06:49:45 +0000 Received: from mail-out2.uio.no ([2001:700:100:10::58]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VH6uL-0002eI-Lc for pgsql-performance@postgresql.org; Wed, 04 Sep 2013 06:49:44 +0000 Received: from mail-mx2.uio.no ([129.240.10.30]) by mail-out2.uio.no with esmtp (Exim 4.75) (envelope-from ) id 1VH6uH-0007NK-Fd; Wed, 04 Sep 2013 08:49:37 +0200 Received: from bbking.uio.no ([129.240.6.205]) by mail-mx2.uio.no with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) user rafael (Exim 4.80) (envelope-from ) id 1VH6uG-0006gA-Vr; Wed, 04 Sep 2013 08:49:37 +0200 Message-ID: <5226D7FF.7020000@usit.uio.no> Date: Wed, 04 Sep 2013 08:49:35 +0200 From: Rafael Martinez Organization: University of Oslo User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130806 Thunderbird/17.0.8 MIME-Version: 1.0 To: Tom Lane CC: pgsql-performance@postgresql.org Subject: Re: SQL statement over 500% slower with 9.2 compared with 9.1 References: <521B4B2A.5010800@usit.uio.no> <17619.1377716890@sss.pgh.pa.us> In-Reply-To: <17619.1377716890@sss.pgh.pa.us> X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-UiO-Ratelimit-Test: rcpts/h 2 msgs/h 1 sum rcpts/h 5 sum msgs/h 2 total rcpts 1711 max rcpts/h 23 ratelimit 0 X-UiO-Spam-info: not spam, SpamAssassin (score=-6.5, required=5.0, autolearn=disabled, FS_LARGE_PERCENT2=2.645, RP_MATCHES_RCVD=-1.165, UIO_MAIL_IS_INTERNAL=-5, UIO_PGP_SIGNED=-3, uiobl=NO, uiouri=NO) X-UiO-Scanned: 09511971BF6C662546AF97161A5706E3CB1BD604 X-UiO-SPAM-Test: remote_host: 129.240.6.205 spam_score: -64 maxlevel 80 minaction 2 bait 0 mail/h: 1 total 1737 max/h 23 blacklist 0 greylist 0 ratelimit 0 X-Pg-Spam-Score: 0.3 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 08/28/2013 09:08 PM, Tom Lane wrote: [..........] > > If you don't want to do any major rewriting, you could probably > stick an OFFSET 0 into the outer EXISTS sub-select (and/or the > inner one) to get something similar to the 9.1 plan. > Thank you for your help. Using OFFSET 0 in SELECT * FROM FilmParticipation C WHERE C.partType = 'cast' AND C.filmId = D.filmId AND C.personId = D.personId OFFSET 0 give us a result similar to 9.1. This SQL is used as an example in one of the database courses at the University. I will send them this information and they can decide if they want to rewrite the statement or use the OFFSET trick. regards, - -- Rafael Martinez Guerrero Center for Information Technology University of Oslo, Norway PGP Public Key: http://folk.uio.no/rafael/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) iEYEARECAAYFAlIm1/8ACgkQBhuKQurGihRAogCePl6G51w8dfYMruj+qSm4Vsjl coMAn2sjyv6PcfsKhASC7ct0WI4YKRtJ =FdeD -----END PGP SIGNATURE----- -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance