From issues-return-87715-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Fri Jan 11 08:33:05 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 F3AEC180648 for ; Fri, 11 Jan 2019 08:33:04 +0100 (CET) Received: (qmail 53643 invoked by uid 500); 11 Jan 2019 07:33:03 -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 53633 invoked by uid 99); 11 Jan 2019 07:33:03 -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; Fri, 11 Jan 2019 07:33:03 +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 EB7871805AC for ; Fri, 11 Jan 2019 07:33:02 +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 0cpzyML0tORq for ; Fri, 11 Jan 2019 07:33:01 +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 CBFCD6115A for ; Fri, 11 Jan 2019 07:33: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 60C75E0104 for ; Fri, 11 Jan 2019 07:33: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 0A6A625580 for ; Fri, 11 Jan 2019 07:33:00 +0000 (UTC) Date: Fri, 11 Jan 2019 07:33:00 +0000 (UTC) From: "Gourav Agrawal (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (IGNITE-10855) Delayed execution when running SQL query involving JOINS and ORDER BY eventually leading to heap OOME. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IGNITE-10855?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16= 740122#comment-16740122 ]=20 Gourav Agrawal commented on IGNITE-10855: ----------------------------------------- Is somebody looking into the issue? > Delayed execution when running SQL query involving JOINS and ORDER BY eve= ntually leading to heap OOME. > -------------------------------------------------------------------------= ----------------------------- > > Key: IGNITE-10855 > URL: https://issues.apache.org/jira/browse/IGNITE-10855 > Project: Ignite > Issue Type: Bug > Components: cache, sql > Affects Versions: 2.7 > Reporter: Gourav Agrawal > Priority: Blocker > Fix For: None > > > To simplify our use-case, we created two caches using the SQL query and l= oaded data consisting of about 4 million records and 60k records approximat= ely, in the respective caches with INDEX created on all the columns. Ignite= is set up to run on a single node, meaning all the data is present on the = same node. The query used for testing/the one we are facing issue with is o= f the type - > _SELECT * FROM CACHE1 C1, CACHE2 C2=C2=A0 WHERE=C2=A0 C1.JOINCol =3D C2.J= OINCol AND C1.COL1 =3D 'someValue' ORDER BY C1.COL2_ > The above query execution leads to the Ignite thread memory rising extens= ively, eventually leading to heap OOME. When the heap memory was increased = to about 14GB,=C2=A0 we were able to get the results back, but the processi= ng time of the query was too long, about 2-4 minutes ( with CPUs =3D2). > We ran an EXPLAIN for the above query and found out that INDEX was create= d on COL1 for C1 cache and on JOINCol for C2 cache. There was no index on t= he sorted column. We think the problem of 'slow querying and huge heap memo= ry requirement' is because of the absence of an index in the sorted column.= Whenever there is a condition present in the WHERE clause ( in our example= C1.COL1=3D'someValue'), Ignite is using an INDEX for that column and there= is no INDEX being created on the ORDER BY column. > And for our use-case, it is imperative that we have a condition in the wh= ere clause ( to filter out the data) and a join condition apart from the or= der by clause. > =C2=A0We tried the multiple column indexing strategy on the COL1, COL2 as= per our use case. > =C2=A0In case of a composite index with the order as (COL1, COL2), INDEX = was created only for the COL1. > While for the composite index order as (COL2, COL1), INDEX was getting cr= eated for both COL1 and COL2 and the results were index sorted. ( But only = in case of the absence of an INDEX for COL1, it looks for the ORDER BY clau= se column and uses a composite index). But, if we don't have a separate IND= EX for COL1, it again poses a problem as COL1 is something which is heavily= used for filtering in all other queries. So an INDEX on COL1 is necessary. > To summarize, In case there is a condition present in the WHERE clause, I= gnite uses the WHERE clause column for indexing, and therefore there is no = INDEX in the sorting column, resulting in severe query performance, which c= an eventually lead us to our system going down. -- This message was sent by Atlassian JIRA (v7.6.3#76005)