Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8E65F200C86 for ; Wed, 31 May 2017 20:27:21 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8CBC9160BCB; Wed, 31 May 2017 18:27:21 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0424E160BC2 for ; Wed, 31 May 2017 20:27:20 +0200 (CEST) Received: (qmail 50336 invoked by uid 500); 31 May 2017 18:27:20 -0000 Mailing-List: contact dev-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list dev@ignite.apache.org Received: (qmail 50325 invoked by uid 99); 31 May 2017 18:27:20 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 May 2017 18:27:20 +0000 Received: from mail-io0-f169.google.com (mail-io0-f169.google.com [209.85.223.169]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id DA45D1A0AB6 for ; Wed, 31 May 2017 18:27:19 +0000 (UTC) Received: by mail-io0-f169.google.com with SMTP id p24so21279531ioi.0 for ; Wed, 31 May 2017 11:27:19 -0700 (PDT) X-Gm-Message-State: AODbwcAJs0H12jhxaQbxsKsOV90ezkUvV9vD7MUyig3VX7Ucad1dT8dS kWb+BtUFIF2QJ2RmR6JDurzoBra13RqP X-Received: by 10.107.37.81 with SMTP id l78mr26186733iol.162.1496255239167; Wed, 31 May 2017 11:27:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.56.67 with HTTP; Wed, 31 May 2017 11:26:38 -0700 (PDT) From: Dmitriy Setrakyan Date: Wed, 31 May 2017 11:26:38 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: nested SQL sub-queries with non-collocated joins To: dev@ignite.apache.org Cc: Sergi Vladykin Content-Type: multipart/alternative; boundary="001a11405fae0642d60550d612cf" archived-at: Wed, 31 May 2017 18:27:21 -0000 --001a11405fae0642d60550d612cf Content-Type: text/plain; charset="UTF-8" Igniters (specifically Sergi), It has come to my attention today that nested sub-select statements, when used in combination with non-collocated joins do not work properly in Ignite. So a query like this, where A, B, and C are all stored in Partitioned caches and are **not** collocated at all, will not work. > *select * from A, B where a.id = b.a_id and b.somefield in > (select somefield from C where c.zipcode = ?)* The main reason it is not supported right now is because, in the absence of collocation, such query may create N^N complexity and it was decided that it is best not supporting it at all. However, I am not sure why N^N complexity is required. Why not support it as follows? 1. execute the nested subquery and store the result in a temporary Replicated table. 2. execute the original query and use the temporary Replicated table instead of the sub-query. Sergi, given that you are the author of the code, can you provide some insight here? Thanks, D. --001a11405fae0642d60550d612cf--