From: Arni S. <Arn...@md...> - 2013-03-22 05:09:02
|
Table "public.table" Column | Type | Modifiers | Storage | Stats target | Description ---------------------------+--------------------------+-----------+----------+--------------+------------- id | bigint | not null | plain | | seq | integer | not null | plain | | text | character varying(256) | | extended | | date_updated | timestamp with time zone | | plain | | Indexes: "table_pkey" PRIMARY KEY, btree (id, seq) "idx_table_dateupdated" btree (date_updated) Child tables: table_1202, table_1203, table_1204, table_1205, table_1206, table_1207, table_1208, table_1209, table_1210, table_1211, table_20121111, table_20121118, table_20121125, table_20121202, table_20121209, table_20121216, table_20121223, table_20121230, table_20130106, table_20130113, table_20130120, table_20130127, table_20130203, table_20130210, table_20130217, table_20130224, table_20130303, table_20130310, table_20130317, table_20130324, table_20130331, table_20130407, table_20130414, table_20130421, table_20130428 Has OIDs: no Table "public.table_2" Column | Type | Modifiers | Storage | Stats target | Description ------------------------------------+--------------------------+-----------+----------+--------------+------------- id | bigint | not null | plain | | text_updated | character varying(1024) | | extended | | date_updated | timestamp with time zone | | plain | | seq | integer | not null | plain | | Indexes: "table_2_pkey" PRIMARY KEY, btree (id, seq) "idx_table2_dateupdated" btree (date_updated) "idx_table2_id" btree (id) Child tables: table_2_120806, table_2_120813, table_2_120820, table_2_120827, table_2_120903, table_2_120910, table_2_120917, table_2_120924, table_2_121001, table_2_121008, table_2_121015, table_2_121022, table_2_121029, table_2_121105, table_2_121112, table_2_121119, table_2_121126, table_2_121203, table_2_121210, table_2_121217, table_2_121224, table_2_121231, table_2_130107, table_2_130114, table_2_130121, table_2_130128, table_2_130204, table_2_130211, table_2_130218, table_2_130225, table_2_130304, table_2_130311, table_2_130318, table_2_130325, table_2_130401, table_2_130408, table_2_130415, table_2_130422, table_2_130429, table_2_130506, table_2_130513, table_2_130520, table_2_130527, table_2_130603, table_2_130610, table_2_130617, table_2_130624, table_2_130701, table_2_130708, table_2_130715, table_2_130722, table_2_130729, table_2_130805, table_2_130812, table_2_130819, table_2_130826, table_2_130902, table_2_130909, table_2_130916, table_2_130923, table_2_130930, table_2_131007, table_2_131014, table_2_131021, table_2_131028, table_2_131104, table_2_131111, table_2_131118, table_2_131125, table_2_131202, table_2_131209, table_2_131216, table_2_131223, table_2_131230, table_2_140106, table_2_140113, table_2_140120, table_2_140127, table_2_140203, table_2_140210, table_2_140217, table_2_140224, table_2_140303, table_2_140310, table_2_140317, table_2_140324, table_2_140331, table_2_140407, table_2_140414, table_2_140421, table_2_140428, table_2_140505, table_2_140512, table_2_140519, table_2_140526, table_2_140602, table_2_140609, table_2_140616, table_2_140623, table_2_140630, table_2_140707, table_2_140714, table_2_140721, table_2_140728, table_2_140804, table_2_140811, table_2_140818, table_2_140825, table_2_140901, table_2_140908, table_2_140915, table_2_140922, table_2_140929, table_2_141006, table_2_141013, table_2_141020, table_2_141027, table_2_141103, table_2_141110, table_2_141117, table_2_141124, table_2_141201, table_2_141208, table_2_141215, table_2_141222, table_2_141229, table_2_150105, table_2_150112, table_2_150119, table_2_150126 Has OIDs: no From: Ashutosh Bapat [mailto:ash...@en...] Sent: Friday, March 22, 2013 12:57 AM To: Arni Sumarlidason Cc: Koichi Suzuki; pos...@li... Subject: Re: [Postgres-xc-general] Planner join logic Hi Arni, By any chance, you have children inheriting from table1 and table2? Can you please send \d+ output on these tables? On Fri, Mar 22, 2013 at 8:49 AM, Arni Sumarlidason <Arn...@md...<mailto:Arn...@md...>> wrote: Hello Mr. Bapat, I modified the output a little, but only the fields selected, QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Hash Join (cost=1.64..5.35 rows=236 width=10726) Output: t.id<https://console.mxlogic.com/redir/?hP3z1EVud79EVdLzCm6kjhOqejo0evigdTVBOZXTLuZPtPuQ9JPHgDN3lJC2LxfUHhBjQ27bCQTQnTPqbbz9EVjujpKroodwLQzh0qmMJmAOcvEn3X5OfM-eDCBQQg1o_og-9Ew4qOwq83WApmdPYfDwedECTzrb38UsqenT3pYEg_QCosxO0>, t.seq, t.text, t.date_updated Hash Cond: (t.id<https://console.mxlogic.com/redir/?2eosod7bNEVd79JYsOMOyqejhOr01PWi1K_cKnLuZXTKrKrSxdKtq4-8qJIMlY9_5qcGuwgVsSC-y--rhpspd7arOrdPr31I5-Aq83iS5GQChzZ2UvoKh-7NQYQKCy0b7X27Nd40zmk3h0vkzaNKvxYY1NJcSYrpop73zhO-UrarRR5I62> = l.id<https://console.mxlogic.com/redir/?4sMUMqenzhOqejrUVBxB4QsCzAS03fWi1K_cKnLuZXTKrKrSxdKtq4-8qJIMlY9_5qcGuwgVsSC-y--rhpspd7arOrdPr31I5-Aq83iS5GQChzZ2UvoKh-7NQYQKCy0b7X27Nd40zmk3h0vkzaNKvxYY1NJASYrpop73zhO-Ur3j24>) -> Append (cost=0.00..0.00 rows=36000 width=5638) -> Data Node Scan on table "_REMOTE_TABLE_QUERY_" (cost=0.00..0.00 rows=1000 width=5638) Output: t.id<https://console.mxlogic.com/redir/?hP3z1EVud79EVdLzCm6kjhOqejo0evigdTVBOZXTLuZPtPuQ9JPHgDN3lJC2LxfUHhBjQ27bCQTQnTPqbbz9EVjujpKroodwLQzh0qmMJmAOcvEn3X5OfM-eDCBQQg1o_og-9Ew4qOwq83WApmdPYfDwedI6Tzrb38UsqenT3ueCo8533qnKK>, t.seq, t.text, t.date_updated Node/s: datanode01d, datanode02d, datanode03d, datanode04d, datanode05d, datanode06d, datanode07d, datanode08d, datanode09d, datanode10d, datanode11d, datanode12d, datanode13d, datanode14d, datanode15d, datanode16d, datanode17d, datanode18d, datanode19d, datanode20d Remote query: SELECT id, seq, text, date_updated FROM ONLY table t WHERE true + 10-20 similar -> Hash (cost=0.00..0.00 rows=131000 width=5088) Output: l.id<https://console.mxlogic.com/redir/?4sMUMqenzhOqejrUVBxB4QsCzAS03fWi1K_cKnLuZXTKrKrSxdKtq4-8qJIMlY9_5qcGuwgVsSC-y--rhpspd7arOrdPr31I5-Aq83iS5GQChzZ2UvoKh-7NQYQKCy0b7X27Nd40zmk3h0vkzaNKvxYY1NJYSYrpop73zhO-Urs1e07wQU>, l.date_updated, l.seq, l.text -> Append (cost=0.00..0.00 rows=131000 width=5088) -> Data Node Scan on table_2 "_REMOTE_TABLE_QUERY_" (cost=0.00..0.00 rows=1000 width=5088) Output: l.id<https://console.mxlogic.com/redir/?4sMUMqenzhOqejrUVBxB4QsCzAS03fWi1K_cKnLuZXTKrKrSxdKtq4-8qJIMlY9_5qcGuwgVsSC-y--rhpspd7arOrdPr31I5-Aq83iS5GQChzZ2UvoKh-7NQYQKCy0b7X27Nd40zmk3h0vkzaNKvxYY1NJMSYrpop73zhO-UrrbcP>, l.date_updated, l.seq, l.text Node/s: datanode01d, datanode02d, datanode03d, datanode04d, datanode05d, datanode06d, datanode07d, datanode08d, datanode09d, datanode10d, datanode11d, datanode12d, datanode13d, datanode14d, datanode15d, datanode16d, datanode17d, datanode18d, datanode19d, datanode20d Remote query: SELECT id, date_updated, seq, text FROM ONLY table_2 l WHERE ((date_updated >= '2012-12-15 00:00:00-05'::timestamp with time zone) AND (date_updated < '2013-01-01 00:00:00-05'::timestamp with time zone)) + 30-50 Similar Thank you for your time, From: Ashutosh Bapat [mailto:ash...@en...<mailto:ash...@en...>] Sent: Friday, March 22, 2013 12:28 AM To: Arni Sumarlidason Cc: Koichi Suzuki; pos...@li...<mailto:pos...@li...> Subject: Re: [Postgres-xc-general] Planner join logic Hi Arni, Can you please send an explain verbose output of this query? On Thu, Mar 21, 2013 at 5:57 PM, Arni Sumarlidason <Arn...@md...<mailto:Arn...@md...>> wrote: As always, thank you for your responses, appreciate it! We are using trunk from around Feb. 18th. Here are some tables that replicate the issue, create table table1( id bigint, seq integer, text data(256), created_at timestamp with time zone, PRIMARY KEY(id, seq)) DISTRIBUTE BY HASH(id); create table table2( id bigint, seq integer, text data_complex(256), update_time timestamp with time zone, PRIMARY KEY(id, seq)) DISTRIBUTE BY HASH(id); Select * from table1 t1, table2 t2 where t2.update_time >= '2012-12-15' and t2.update_time < '2013-01-01' and t2.id<https://console.mxlogic.com/redir/?2eosod7bNEVd79JYsOMOyqejhOr01PjWi1K_cKnLuZXTKrKrSxdKtq4-8qJIMlY9_5qcGuwgVsSYYyCrhpspd7arz3XxJxwS2_id41Fr2Rqj8N-xsfIn8_3UWuqnjh05zZx3UCy0hHa1EwfGhBoTfM-u0USyrjdIIczxNEVvsdVuuN3I-tei91>=t1.id<https://console.mxlogic.com/redir/?zC763hOYqejhOrv7cIcECzAQsCM0sQuAwrLPbBXTLuZXCXCZEjrDmxfy6Hrc5v2vNmzaDE4endLf8FCQmn6jhOCUM-UroodwLQzh0qmMJmAOcvEn3X5OfM-eDCBQQg1o_og-9Ew4qOwq83WApmdPYfDwedFCQPrb38UsqenT3qiXMGWXj> Thank you, Arni -- Best Wishes, Ashutosh Bapat EntepriseDB Corporation The Enterprise Postgres Company -- Best Wishes, Ashutosh Bapat EntepriseDB Corporation The Enterprise Postgres Company |