From issues-return-89562-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Tue Jan 29 09:54:11 2019 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 BE3C7180625 for ; Tue, 29 Jan 2019 09:54:10 +0100 (CET) Received: (qmail 83216 invoked by uid 500); 29 Jan 2019 08:54:09 -0000 Mailing-List: contact issues-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 issues@ignite.apache.org Received: (qmail 83206 invoked by uid 99); 29 Jan 2019 08:54:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jan 2019 08:54:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 5B039180DC6 for ; Tue, 29 Jan 2019 08:54:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, 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 (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id q3bltXBXA5_k for ; Tue, 29 Jan 2019 08:54:07 +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 DF7F460DDC for ; Tue, 29 Jan 2019 08:54:03 +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 752EDE26AA for ; Tue, 29 Jan 2019 08:54:03 +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 31CDC243D7 for ; Tue, 29 Jan 2019 08:54:01 +0000 (UTC) Date: Tue, 29 Jan 2019 08:54:01 +0000 (UTC) From: "Alexander Lapin (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (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 [ https://issues.apache.org/jira/browse/IGNITE-10305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16754750#comment-16754750 ] Alexander Lapin commented on IGNITE-10305: ------------------------------------------ [~vozerov] Tests added. > 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 > Assignee: Alexander Lapin > Priority: Major > Labels: iep-24 > Fix For: 2.8 > > Time Spent: 40m > Remaining Estimate: 0h > > 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)