Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fF2VN-0007b1-3r for pgsql-general@arkaria.postgresql.org; Sat, 05 May 2018 19:06:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fF2VK-0004Fe-GW for pgsql-general@arkaria.postgresql.org; Sat, 05 May 2018 19:05:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fF2VK-0004FU-8V for pgsql-general@lists.postgresql.org; Sat, 05 May 2018 19:05:58 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fF2VE-0000q3-R6 for pgsql-general@postgresql.org; Sat, 05 May 2018 19:05:57 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 72D342127F; Sat, 5 May 2018 15:05:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 05 May 2018 15:05:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=wRwXFyBlYQV8BBKSvwQ7Zrpcj2Sj2 upzl5vJBeADoDM=; b=Psa3+fj7aulLO/NnHD2fIbM37WmctlDjlAZivF4nQSfg6 tMDpWjDvhbd9Ai8FUF22wJ78uWRJb0IUdlDRW99i4/w2JwkoWbXhYW7QCaNy/zEQ IaJe5oGsKYcwmczzTl13SpAnqD0f5KLq2GiFBM4h6CYvK/eUgZ/SdqQ+NoAmv3FM F9JmLjN5ConcMA6cqQB9hMWangqZz/3b5YTMC+XYKEIy36v2q3rhepZX9dvyF69f Lm2rcU1pnfKBC0+qu+Am4V0LhXskt53uDhek02uHIskwjiYaC2Jcu8FiLTfvSAom CcDfhKckJRBIQ6uc6e0MW7QJToU8JJwsWFQBHuD1A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=wRwXFy BlYQV8BBKSvwQ7Zrpcj2Sj2upzl5vJBeADoDM=; b=nV0iADX9MKhLNcpbgPkUID U0KEoFn70m8/2zMxlKm0oV76hOzOXwF5FuaKzpgDSVritrd7SZMAQtP48zxu+4V5 kLZthFLMIHQyX4bJecasSu5nbQpo+hOHf3puJLUG9lUHuCkYCoBnK8ze7RXlBnf9 BmAG3vLU99hrgDl85NibhNpfrqhhVwh5Xcorq0UMZY3k6rLUB5fjZg5HHTPyjVKu DBqdbSsVzooWS5tGdi6SypbzvvPAmTAAdElmzPt27psvtou9LcF6CDwu7FbPSs5c xKdeHxpJbK6nBcKRIWUrhFvTv24tloC6uP/jdVnDxwCJWDOR3QVoVAamLXBspeQA == X-ME-Sender: Received: from [192.168.1.2] (unknown [71.212.135.74]) by mail.messagingengine.com (Postfix) with ESMTPA id DD80DE5094; Sat, 5 May 2018 15:05:49 -0400 (EDT) Subject: Re: comparison between 2 execution plans To: Neto pr Cc: PostgreSQL General References: <793ad4e8-82cd-74e7-a4ff-b39d049b2568@aklaver.com> From: Adrian Klaver Message-ID: Date: Sat, 5 May 2018 12:05:49 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 05/05/2018 10:51 AM, Neto pr wrote: > Dear, > > > 2018-05-05 9:57 GMT-07:00 Adrian Klaver >: > > On 05/05/2018 06:26 AM, Neto pr wrote: > > It might help if you explained what 'version with source code > changed by me' means? > > > Postgresql with modified source code, is that I modified some internal > functions of cost (source code) and parameters in Postgresql.conf so > that it is possible for the DBMS to differentiate cost of read (random > and sequence) and write (random and sequence), this is because reading > in SSDs' and more than 400 times faster than HDD. This is due to > academic research that I am doing. Seems to me that the above may enter into the difference between instances. Someone with more knowledge of the Postgres internals then I would need to comment, contingent on seeing the changes I would presume. Also from my previous post: Any reason why the index changed between instances? > > > Also the schema for the table lineitem from both instances might > help shed light. > > > see schema of the tables below: > https://docs.snowflake.net/manuals/_images/sample-data-tpch-schema.png > > I am using 40g scale, in this way the lineitem table has (40 * 6 > million) 240 million of the rows. > > > Any reason why the index changed between instances? > > > > index on l_orderkey (table lineitem). > > Some doubts > - Difference between GroupAggregate and Finalize GroupAggregate > - because some algorithms show measurements on "Disk" and others > on "Memory" example: >       - External sort Disk: 52784kB >       - quicksort Memory: 47770kB > > Because one execution plan was much smaller than the other, > considering that the query is the same and the data are the same. > -------------------------------------------------- > select >      l_orderkey, >      sum(l_extendedprice * (1 - l_discount)) as revenue, >      o_orderdate, >      o_shippriority > from >      customer, >      orders, >      lineitem > where >      c_mktsegment = 'HOUSEHOLD' >      and c_custkey = o_custkey >      and l_orderkey = o_orderkey >      and o_orderdate < date '1995-03-21' >      and l_shipdate > date '1995-03-21' > group by >      l_orderkey, >      o_orderdate, >      o_shippriority > order by >      revenue desc, >      o_orderdate > -------------------------------------------------- > > best regards > Neto > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > > > Regards > Neto -- Adrian Klaver adrian.klaver@aklaver.com