Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f8XFi-00060e-TW for pgsql-performance@arkaria.postgresql.org; Tue, 17 Apr 2018 20:30:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f8XFh-0001Sq-GN for pgsql-performance@arkaria.postgresql.org; Tue, 17 Apr 2018 20:30:57 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f8XFh-0001Sh-5r for pgsql-performance@lists.postgresql.org; Tue, 17 Apr 2018 20:30:57 +0000 Received: from mail-wr0-x234.google.com ([2a00:1450:400c:c0c::234]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f8XFc-0003Pc-NG for pgsql-performance@lists.postgresql.org; Tue, 17 Apr 2018 20:30:55 +0000 Received: by mail-wr0-x234.google.com with SMTP id w3so22365686wrg.2 for ; Tue, 17 Apr 2018 13:30:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=/asu9LSQlw7KKI5Nlko7v/cvXt3agSX1Pbmm8GgES6I=; b=oAUOD0x1wcH/vAPbujbPfnw7r+4MyK//u4ZOS0qm4WVSgWYuwWRIDYOLLB/vlYi2sH lNxYgiQq1vkMEY2ZL65cpMoCUSkPRxwZV/DCgrxjGB1WjSwxW6GgpWUf8sfggoICTQQ2 xhvMtlYvmQaPEfSKGtWrlibvySrgE6//gG13H9N7rMKFYaLIjro7nZPJxKp/5tnzDyjP JGOpewXswepu56s0yiO6aD0kUIvFn+LYTsRJNasMtLmRUoCqeUVU+ZvnwJhXzehWhom8 lvG2ykZvq86A2XcyM8SvMJlyTQM9Axffs2UmjAClLaNGgBrGkoecKbUloOFOaIspyhWb lu+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/asu9LSQlw7KKI5Nlko7v/cvXt3agSX1Pbmm8GgES6I=; b=Ed3iayDTw5OrBhnCfecR0Pt/R7Issfdt5BFkJ3i7YnP6kix1URxM1iRxnBoctLc+xC QaObdi/M19Z0srBzhRFox/u4N3fotB2qiHdWKZBv6IV+PftjWhHOllUr6izWVYSESEHf a7lR3zWc8w3Zl8lhA52kQXvU5pK4DrRy5rX/qF2fVR3l17Ba9t8g98pxE2EGZTG7rX7q Ud/dtAGJqmhFB9Neom0AE7Zr9ratBNK9lo/Zb22pu/W+GY6XSm8yRhuWC1vVU4CEvOIp iFMv4mVYre0VYsUYWxg2mAH7wtSjeyXQF0oiwXEKAJ4R+3HVFGmZ2DH3iZ1NQXHliyOd lCJw== X-Gm-Message-State: ALQs6tCnOe0Gv5x/DL9fj9hfvhR0uZ4e4vQ3w4+J7f2fhd55Tih3i5R8 1TIsZwS6aoKa5mNOyeqqQWAISw== X-Google-Smtp-Source: AIpwx4+80diq63WTCisAxk8Jfklr5SjMDPXJWumZjQO/lI3r1QmGSDHobfIfON+ajMO0djEHE+e74Q== X-Received: by 10.223.196.196 with SMTP id o4mr2764482wrf.173.1523997050938; Tue, 17 Apr 2018 13:30:50 -0700 (PDT) Received: from [10.137.2.19] (ip-78-102-97-226.net.upcbroadband.cz. [78.102.97.226]) by smtp.gmail.com with ESMTPSA id 19sm16824137wmn.40.2018.04.17.13.30.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Apr 2018 13:30:50 -0700 (PDT) Subject: Re: Unexplainable execution time difference between two test functions...one using IF (SELECT COUNT(*) FROM...) and the other using IF EXISTS (SELECT 1 FROM...) To: Hackety Man , Pavel Stehule , Pgsql Performance Cc: Robert Haas References: From: Tomas Vondra Message-ID: Date: Tue, 17 Apr 2018 22:30:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 04/17/2018 04:05 PM, Hackety Man wrote: > Hi Pavel, > > Thanks for sharing that information.  I was not aware that the parallel > query functionality was not yet fully implemented. > Nothing is ever "fully implemented". There are always gaps and possible improvements ;-) That being said, parallelism opens an entirely new dimension of possible plans and planning issues. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services