Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YJeWi-0003Ln-8n for pgsql-performance@arkaria.postgresql.org; Fri, 06 Feb 2015 08:44:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YJeWh-00071u-9I for pgsql-performance@arkaria.postgresql.org; Fri, 06 Feb 2015 08:44:35 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YJeWg-00071o-FF for pgsql-performance@postgresql.org; Fri, 06 Feb 2015 08:44:34 +0000 Received: from mwork.nabble.com ([162.253.133.43]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YJeWc-0002Ig-MA for pgsql-performance@postgresql.org; Fri, 06 Feb 2015 08:44:32 +0000 Received: from msam.nabble.com (unknown [162.253.133.85]) by mwork.nabble.com (Postfix) with ESMTP id 43D2012FFD95 for ; Fri, 6 Feb 2015 00:44:30 -0800 (PST) Date: Fri, 6 Feb 2015 01:44:29 -0700 (MST) From: Belal Al-Hamed To: pgsql-performance@postgresql.org Message-ID: <1423212269828-5836890.post@n5.nabble.com> In-Reply-To: References: <1423211439320-5836886.post@n5.nabble.com> Subject: Re: Copy command Faster than original select MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 thanks, but isn't copy use the same plan ??? any way this is the query play "Sort (cost=15402.76..15511.77 rows=43602 width=184)" " Output: "Sessions"."SesUser", "Vouchers"."VouID", "Journals"."JurMuniment", "Journals"."JurRefID", "Journals"."JurDate", "Vouchers"."VouJournal", "Vouchers"."VouMunNumber", "Vouchers"."VouDate", "Vouchers"."VouNote", "Vouchers"."VouDoc", "Journals"."JurM (...)" " Sort Key: "VouItems"."ItmDate", "Vouchers"."VouID", "VouItems"."ItmNumber"" " -> Hash Join (cost=4665.21..8164.77 rows=43602 width=184)" " Output: "Sessions"."SesUser", "Vouchers"."VouID", "Journals"."JurMuniment", "Journals"."JurRefID", "Journals"."JurDate", "Vouchers"."VouJournal", "Vouchers"."VouMunNumber", "Vouchers"."VouDate", "Vouchers"."VouNote", "Vouchers"."VouDoc", "Journals" (...)" " Hash Cond: ("VouItems"."ItmMaster" = "Vouchers"."VouID")" " -> Seq Scan on public."VouItems" (cost=0.00..1103.02 rows=43602 width=89)" " Output: "VouItems"."ItmMaster", "VouItems"."ItmNumber", "VouItems"."ItmCurDebit", "VouItems"."ItmCurCredit", "VouItems"."ItmAccount", "VouItems"."ItmBranch", "VouItems"."ItmSubAccount", "VouItems"."ItmMuniment", "VouItems"."ItmDate", "VouItem (...)" " -> Hash (cost=4107.41..4107.41 rows=20544 width=95)" " Output: "Vouchers"."VouID", "Vouchers"."VouJournal", "Vouchers"."VouMunNumber", "Vouchers"."VouDate", "Vouchers"."VouNote", "Vouchers"."VouDoc", "Vouchers"."VouIsHold", "Vouchers"."VouCreateDate", "Vouchers"."VouDebit", "Vouchers"."VouCredit" (...)" " -> Hash Join (cost=1793.25..4107.41 rows=20544 width=95)" " Output: "Vouchers"."VouID", "Vouchers"."VouJournal", "Vouchers"."VouMunNumber", "Vouchers"."VouDate", "Vouchers"."VouNote", "Vouchers"."VouDoc", "Vouchers"."VouIsHold", "Vouchers"."VouCreateDate", "Vouchers"."VouDebit", "Vouchers"."VouC (...)" " Hash Cond: ("Vouchers"."VouJournal" = "Journals"."JurID")" " -> Hash Join (cost=1236.16..3165.12 rows=20544 width=74)" " Output: "Vouchers"."VouID", "Vouchers"."VouJournal", "Vouchers"."VouMunNumber", "Vouchers"."VouDate", "Vouchers"."VouNote", "Vouchers"."VouDoc", "Vouchers"."VouIsHold", "Vouchers"."VouCreateDate", "Vouchers"."VouDebit", "Vouchers" (...)" " Hash Cond: ("Vouchers"."VouSession" = "Sessions"."SesID")" " -> Seq Scan on public."Vouchers" (cost=0.00..883.44 rows=20544 width=78)" " Output: "Vouchers"."VouID", "Vouchers"."VouJournal", "Vouchers"."VouMunNumber", "Vouchers"."VouDate", "Vouchers"."VouNote", "Vouchers"."VouDoc", "Vouchers"."VouIsHold", "Vouchers"."VouCreateDate", "Vouchers"."VouDebit", "Vou (...)" " -> Hash (cost=654.85..654.85 rows=33385 width=12)" " Output: "Sessions"."SesUser", "Sessions"."SesID"" " -> Seq Scan on public."Sessions" (cost=0.00..654.85 rows=33385 width=12)" " Output: "Sessions"."SesUser", "Sessions"."SesID"" " -> Hash (cost=417.04..417.04 rows=11204 width=29)" " Output: "Journals"."JurMuniment", "Journals"."JurRefID", "Journals"."JurDate", "Journals"."JurMunNumber", "Journals"."JurID"" " -> Seq Scan on public."Journals" (cost=0.00..417.04 rows=11204 width=29)" " Output: "Journals"."JurMuniment", "Journals"."JurRefID", "Journals"."JurDate", "Journals"."JurMunNumber", "Journals"."JurID"" -- View this message in context: http://postgresql.nabble.com/Copy-command-Faster-than-original-select-tp5836886p5836890.html Sent from the PostgreSQL - performance mailing list archive at Nabble.com. -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance