From dev-return-41913-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Fri Nov 16 18:39:03 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 46BF9180670 for ; Fri, 16 Nov 2018 18:39:03 +0100 (CET) Received: (qmail 28598 invoked by uid 500); 16 Nov 2018 17:39:02 -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 28587 invoked by uid 99); 16 Nov 2018 17:39:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Nov 2018 17:39:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id BCF33D6FB1 for ; Fri, 16 Nov 2018 17:39:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id kTrhJI-yKzYU for ; Fri, 16 Nov 2018 17:39:00 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id A61CC5F1BD for ; Fri, 16 Nov 2018 17:39:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 523FEE1013 for ; Fri, 16 Nov 2018 17:39:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 164F42135D for ; Fri, 16 Nov 2018 17:39:00 +0000 (UTC) Date: Fri, 16 Nov 2018 17:39:00 +0000 (UTC) From: "Vladimir Ozerov (JIRA)" To: dev@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (IGNITE-10305) SQL: Optimize query execution if it targets only one or none partitions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Vladimir Ozerov created IGNITE-10305: ---------------------------------------- Summary: SQL: Optimize query execution if it targets only one or none partitions Key: IGNITE-10305 URL: https://issues.apache.org/jira/browse/IGNITE-10305 Project: Ignite Issue Type: Task Components: sql Reporter: Vladimir Ozerov Fix For: 2.8 This is a part of "Partition Pruning" IEP [1]. Currently we try to extract partitions from map queries and route requests accordingly. Several problems with this approach: 1) Individual map queries may target the same partition, but we never know that, so we may want to setup a merge table when it is not really needed. 2) Sometimes query may reduce to no partitions. In this case we should not execute anything at all and simply return empty result set. 3) If the whole query targets only one partition, we may skip the whole splitter phase! I propose to do the following: # Try to extract partition from "original" query. # If we see that exactly one partition is involved, then original query is a map query, and reduce should be performed in "skip merge table" mode # If we see that there are no partitions because query is invalid (e.g. {{id = 1 AND id = 2}}), then stop and return no results. This decision should be cached in two-step plan. # If we see that there are some partitions, then we should apply arguments and see the result. If result set is empty - return, but do not cache empty result set decision, as it may change for another set of arguments. # If none of above hold, then do pushdowns and split, and analyze partitions of individual map queries. For those of them where partition set is empty, we should return empty result set without executing anything. [1] https://cwiki.apache.org/confluence/display/IGNITE/IEP-24%3A+SQL+Partition+Pruning -- This message was sent by Atlassian JIRA (v7.6.3#76005)