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 C50CF200D20 for ; Tue, 17 Oct 2017 10:43:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C21831609EB; Tue, 17 Oct 2017 08:43:09 +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 E92CD1609DE for ; Tue, 17 Oct 2017 10:43:08 +0200 (CEST) Received: (qmail 68233 invoked by uid 500); 17 Oct 2017 08:43:08 -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 68221 invoked by uid 99); 17 Oct 2017 08:43:07 -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, 17 Oct 2017 08:43:07 +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 06E601805C8 for ; Tue, 17 Oct 2017 08:43:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com 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 wY54P8LhifCH for ; Tue, 17 Oct 2017 08:43:04 +0000 (UTC) Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 7DAD25F1D5 for ; Tue, 17 Oct 2017 08:43:04 +0000 (UTC) Received: by mail-wm0-f46.google.com with SMTP id t69so2255150wmt.2 for ; Tue, 17 Oct 2017 01:43:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=TYl44gZ2ZAHLt3f+szvi9J87guJ7stJTXab801F/NOE=; b=iwSFL/0pS70zYIHirqrFHLNtUYOXOEXCY1oeRMTXqiWMGMkKfOL2N5V5zzSFmepnKp A/95Zx0YDdTXEylwjHNt9CZfz/amoqrZFwBDOX0Z+XqzF8LdMpU6knkpIBvvjvwibYfc mibOzxzRH6bXvddK8ojB6+Ar9RNrzB3FMRmIXeC7UnJZDOrhd98rXB/zK5rPAgysBavJ T5M4L7ZTbvM50lNQzVsKTVQHHSQcdKfgi19Waz0uA/9L90KwmOCVGugXB5qOeQmLh4RW rbjD2snco4WLsnZQuijh4LpyjoKwiq02FKxIO/z0WFgrINXw49oQonC0UtKLjZhxyPzL QoaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=TYl44gZ2ZAHLt3f+szvi9J87guJ7stJTXab801F/NOE=; b=HXF/uCxlepA9KYAlkglDpBxZYhshbZzzmiBYhhsXAQlRvpUhiLz8h5ef3f7X1pKYex CN9G+OqdKeSmh501aWKf7RzgIFynpxoDdpPQp+ruicFm5xKNleNvbSB8d5dswWsChZ5y kKEldOn7Dxtk+cJtD/FgBaHXRVGpNWWWPtS0tWL/7lJF9Mk/cI4jrg5mErSysRtRJIRP XJPYgIaw6HdLbP1PSpKqsKHbleAT8BhJCw6Mjb6dHH+fdKzlD8hnSVVZOOPCbt2aFfzU Mpo7cx8m8qMF3XvPUvQd1c/JWguyILFLqSexVqcBibDomEGP9hfig5rYkF834tW6Pk/T XavA== X-Gm-Message-State: AMCzsaX1MzDLkX+ZqiKBNcf6uGBfUqvqzLdtWf3vLzR3ZbnJn21UN7Q8 rtTXIDuCYlDdoSv0R+ggCUqS1+z/7X4wdbRBLNY= X-Google-Smtp-Source: AOwi7QBH6GisjgSiBXLrhqUf2oL6RftrwnfiVLGk0cJrc5RVkg4dbeisy7tqDzvafwjo3TWl32QYrgymwhF9gJN4Z4k= X-Received: by 10.80.173.150 with SMTP id a22mr15160173edd.49.1508229783862; Tue, 17 Oct 2017 01:43:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.167.194 with HTTP; Tue, 17 Oct 2017 01:43:03 -0700 (PDT) In-Reply-To: References: From: Alexey Goncharuk Date: Tue, 17 Oct 2017 11:43:03 +0300 Message-ID: Subject: Re: Indexing fields of non-POJO cache values To: dev@ignite.apache.org Content-Type: multipart/alternative; boundary="94eb2c0a525081c36e055bba1c69" archived-at: Tue, 17 Oct 2017 08:43:10 -0000 --94eb2c0a525081c36e055bba1c69 Content-Type: text/plain; charset="UTF-8" Alexey K., looks like this will require significant changes in H2 (I cannot find anything on partial indexes there). Vladimir, any ideas? 2017-10-17 11:35 GMT+03:00 Alexey Kuznetsov : > Alexey G., > > > How these field extractors will be configured. QueryField and > QueryIndex are > already quite complex classes. > > Adding such a closure to configuration would complicate them even > further. > May be we can go in "JavaScript" way and pass a string with expression that > will be parsed and evaluated later on server side. > > > How these extractors will interact with future SQL drivers (my current > guess > - there is no way to define them in SQL) > > AFAIK RDBMS support index on expression. > For example: https://sqlite.org/expridx.html > > Make sense? > > On Tue, Oct 17, 2017 at 3:26 PM, Alexey Goncharuk < > alexey.goncharuk@gmail.com> wrote: > > > I like this idea. In general case, this will not even require > > deserializing the cache value. Consider a binary tree implementation > with a > > binary object node {val, left, right}. In this case, it is impossible to > > have an index of min or max, but with Andrey's suggestion, these indexes > > are trivially extracted. > > > > Two things to consider: > > * How these field extractors will be configured. QueryField and > QueryIndex > > are already quite complex classes. Adding such a closure to configuration > > would complicate them even further. > > * How these extractors will interact with future SQL drivers (my current > > guess - there is no way to define them in SQL) > > > > Andrey, can you create a ticket and suggest an API design so we can > review > > it? > > > > Thanks, > > AG > > > > 2017-10-17 5:44 GMT+03:00 Andrey Kornev : > > > > > Of course it does, Dmitriy! However as I suggested below, the feature > > > should be optional. The current behavior (not requiring user classes on > > the > > > server, etc.) would remain the default one. > > > > > > Also, please realize that not everyone stores their data as POJOs or > uses > > > Ignite as a JDBC source -- the use cases that appear to have been the > > main > > > focus of Ignite community lately. > > > > > > Payloads with dynamic structures require more advanced mechanisms for > > > indexing, for example, to avoid the overhead of duplicating the > indexable > > > fields as top level fields of the BinaryObjects. In cases where the > cache > > > sizes are in tens of millions of entries, the ability to generate index > > > values on the fly rather than store them, would go a long way in terms > of > > > reducing memory utilization. > > > > > > In Ignite community finds this feature generally useful, I'd be more > than > > > happy to contribute its implementation. > > > > > > Regards > > > Andrey > > > > > > ________________________________ > > > From: Dmitriy Setrakyan > > > Sent: Monday, October 16, 2017 6:14 PM > > > To: dev@ignite.apache.org > > > Subject: Re: Indexing fields of non-POJO cache values > > > > > > On Mon, Oct 16, 2017 at 12:35 PM, Andrey Kornev < > > andrewkornev@hotmail.com> > > > wrote: > > > > > > > [Crossposting to the dev list] > > > > > > > > Alexey, > > > > > > > > Yes, something like that, where the "reference"/"alias" is expressed > > as a > > > > piece of Java code (as part of QueryEntity definition, perhaps) that > is > > > > invoked by Ignite at the cache entry indexing time. > > > > > > > > My point is that rather than limiting indexable fields only to > > predefined > > > > POJO attributes (or BinaryObject fields) Ignite could adopt a more > > > general > > > > approach by allowing users designate an arbitrary piece of code (a > > > > lambda/closure) to be used as an index value extractor. In such case, > > the > > > > current functionality (extracting index values from POJO attributes) > > > > becomes just a special case that's supported by Ignite out of the > box. > > > > > > > > > > Andrey, this would require deserialization on the server side. It would > > > also require that user classes are present on the server side. Both of > > this > > > scenarios Ignite tries to avoid. > > > > > > Makes sense? > > > > > > > > > -- > Alexey Kuznetsov > --94eb2c0a525081c36e055bba1c69--