From dev-return-49395-archive-asf-public=cust-asf.ponee.io@couchdb.apache.org Mon May 25 07:25:26 2020 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 [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id C596E18062C for ; Mon, 25 May 2020 09:25:25 +0200 (CEST) Received: (qmail 86382 invoked by uid 500); 25 May 2020 07:25:24 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 86365 invoked by uid 99); 25 May 2020 07:25:24 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 May 2020 07:25:24 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 8D0AD1A43E8 for ; Mon, 25 May 2020 07:25:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-he-de.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 5OdCTJgZo3lA for ; Mon, 25 May 2020 07:25:22 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::72f; helo=mail-qk1-x72f.google.com; envelope-from=glynn.bird@gmail.com; receiver= Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTPS id A5FED7DCF9 for ; Mon, 25 May 2020 07:25:21 +0000 (UTC) Received: by mail-qk1-x72f.google.com with SMTP id w3so11243247qkb.6 for ; Mon, 25 May 2020 00:25:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=ZODYXl/r/cabni2+5NKMMI1OJzM4lHvi6f4lg8tsv7w=; b=JbN6t2hM08g494eTgbmWHZDeRtOX1il1kiOk7JXro4zT85uG/qpxIHtESa90Pvz3jv Qun4UMN7Bs2Mh5SI1DOwExj/oXG7P/X49CYjyYnJLzzGaPST/F0tIIHHleYAAie9/C0T 3nwqA0GlcnfxDlNSDYpWfy0LHlP7uzGQxvVLxG/AHzQlz1gURf713A6KpMyjG1RNXykq iWyYyShPQ1lN/ndyX2l3OOlTi0mNwaQfa2Vi3soe9LxIs60hV8BwWNCCcOK0znxeSDn7 a9WScavX+a1R5qmbretzE3GbfhzEystDztak5VfwgXXskEqCJ1VzSM2d6E169EHz2+cR pLdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=ZODYXl/r/cabni2+5NKMMI1OJzM4lHvi6f4lg8tsv7w=; b=hpj/y3h6lmuEtwzogExe1UAWPl1qOlzhgdDi/ZGso0W397ZalZP9EISphGdteN4Ey1 RVK0Pu0v4A3Arw08DWnLQkQ9CQeqL7tM6nmv5jMAJwwlOJecsaiXV6Gr4uYY0NTFVJbU IBnPzqjn2IloJruvOiIivf/gqlQa49x2IFJCcLNCBxkM3EuRszjiaLV0FGDofIx6pglE 2p7vcGPheihrRHloHYBWQnew/KuJ0SXYyeeSempQKnxQNy8qbXPEL3nO9xX0IUbMBZiB re2Fgvm/UaF+H7g2pwL9Esmef1iFdXHY7jzoItuL39YLhWR2AxCtobKSlung8oo/kKVs JeOA== X-Gm-Message-State: AOAM533mIFb00p1+bEYR/puhPkDlIUUvgbJxtWDE+cB8R6ZzXPWnG3AU h3nqaluxHjhSIDI/pLhaKs5rFySMOl5aI+Qcm1AINuVocQo= X-Google-Smtp-Source: ABdhPJxWJUyIKjINdEQSJWn7HYm6hGDwBSLIBcCVX/u8ZL1SkXNur/sf4mHEcnHptVCyWRZSd0EJ4e7iBPwAWnmwh/s= X-Received: by 2002:a05:620a:ecf:: with SMTP id x15mr23562151qkm.465.1590391514691; Mon, 25 May 2020 00:25:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Glynn Bird Date: Mon, 25 May 2020 08:25:03 +0100 Message-ID: Subject: Re: Partitions list To: dev@couchdb.apache.org Content-Type: multipart/alternative; boundary="000000000000497dca05a673e1c9" --000000000000497dca05a673e1c9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable If you need a relatively small list of partition keys, (let's say you want to allow a user to paginate through the partition keys in blocks of 10, say) then it's probably more efficient to perform a sequence of calls to _all_docs, fetching the "first" document of each partition key like so: https://gist.github.com/glynnbird/73fea65a12b0c420562108a80ea0c449 This consumes one _all_docs?limit=3D1 request per partition key you need an= d may be more efficient than reading all the ids in a database. On Mon, 25 May 2020 at 00:30, ermouth wrote: > Thanks! > > > comp sci theoretically nothing that=E2=80=99ll be any more > > efficient internally than the obvious map/reduce view > > This probably doesn=E2=80=99t hold in real world at least for DBs you kno= w upfront > have number_of_partitions =E2=89=83 number_of_docs < several_thousands. R= eading all > _id-s without reduce is likely cheaper in that case. Which means I might > just read _id-s for DBs having say < 10k docs, without writing a ddoc wit= h > map/reduce view and waiting it to warm up. Or I can allow user to choose > what to do. > > ermouth > > > =D0=BF=D0=BD, 25 =D0=BC=D0=B0=D1=8F 2020 =D0=B3. =D0=B2 01:58, Paul Davis= : > > > Currently no, and comp sci theoretically nothing that=E2=80=99ll be any= more > > efficient internally than the obvious map/reduce view. > > > > On Sun, May 24, 2020 at 12:48 PM ermouth wrote: > > > > > Hi devs, > > > > > > is there a way to get the list of DB partitions, except dedicated > > > map/reduce? Trying to add partitioned queries UI into Photon and bit > > stuck > > > how to implement it. > > > > > > ermouth > > > > > > --000000000000497dca05a673e1c9--