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 CDF96200D5C for ; Fri, 15 Dec 2017 09:44:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id CC6CE160C26; Fri, 15 Dec 2017 08:44:05 +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 1FB5D160C06 for ; Fri, 15 Dec 2017 09:44:04 +0100 (CET) Received: (qmail 19060 invoked by uid 500); 15 Dec 2017 08:44:04 -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 19046 invoked by uid 99); 15 Dec 2017 08:44:04 -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, 15 Dec 2017 08:44:04 +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 ECE8D180874 for ; Fri, 15 Dec 2017 08:44:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id dHAg1jmRN_MI for ; Fri, 15 Dec 2017 08:44:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 930A55F2EE for ; Fri, 15 Dec 2017 08:44:01 +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 C8897E129D for ; Fri, 15 Dec 2017 08:44: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 871E327409 for ; Fri, 15 Dec 2017 08:44:00 +0000 (UTC) Date: Fri, 15 Dec 2017 08:44:00 +0000 (UTC) From: "Vladimir Ozerov (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (IGNITE-7167) Optimize 'select count(*) from Table' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 15 Dec 2017 08:44:06 -0000 [ https://issues.apache.org/jira/browse/IGNITE-7167?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vladimir Ozerov resolved IGNITE-7167. ------------------------------------- Resolution: Duplicate We already optimized this, see IGNITE-6702. We cannot get rid of scan in general case. For now we iterate over index entries and count them. This is the best what can be done. However, when MVCC is ready, we will have to resort to (almost) original approach - for every entry in the index we would have to check whether it is visible. > Optimize 'select count(*) from Table' > ------------------------------------- > > Key: IGNITE-7167 > URL: https://issues.apache.org/jira/browse/IGNITE-7167 > Project: Ignite > Issue Type: Improvement > Components: sql > Affects Versions: 2.3 > Reporter: Valentin Kulichenko > > Currently query like {{select count(*) from Table}} effectively scans the cache and take a lot of time for large datasets. Probably makes sense to optimize it to use {{IgniteCache#size}} directly when possible. -- This message was sent by Atlassian JIRA (v6.4.14#64029)