From user-return-483-apmail-phoenix-user-archive=phoenix.apache.org@phoenix.incubator.apache.org Sun Apr 6 16:17:06 2014 Return-Path: X-Original-To: apmail-phoenix-user-archive@minotaur.apache.org Delivered-To: apmail-phoenix-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 170D51116C for ; Sun, 6 Apr 2014 16:17:06 +0000 (UTC) Received: (qmail 16839 invoked by uid 500); 6 Apr 2014 16:17:05 -0000 Delivered-To: apmail-phoenix-user-archive@phoenix.apache.org Received: (qmail 16744 invoked by uid 500); 6 Apr 2014 16:17:05 -0000 Mailing-List: contact user-help@phoenix.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@phoenix.incubator.apache.org Delivered-To: mailing list user@phoenix.incubator.apache.org Received: (qmail 16729 invoked by uid 99); 6 Apr 2014 16:17:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Apr 2014 16:17:04 +0000 X-ASF-Spam-Status: No, hits=-1998.1 required=5.0 tests=ALL_TRUSTED,HTML_MESSAGE,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 06 Apr 2014 16:17:03 +0000 Received: (qmail 16664 invoked by uid 99); 6 Apr 2014 16:16:43 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Apr 2014 16:16:43 +0000 Received: from localhost (HELO mail-yh0-f52.google.com) (127.0.0.1) (smtp-auth username jamestaylor, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Apr 2014 16:16:43 +0000 Received: by mail-yh0-f52.google.com with SMTP id c41so4995438yho.11 for ; Sun, 06 Apr 2014 09:16:42 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.236.135.197 with SMTP id u45mr1543480yhi.150.1396801002426; Sun, 06 Apr 2014 09:16:42 -0700 (PDT) Received: by 10.170.195.68 with HTTP; Sun, 6 Apr 2014 09:16:42 -0700 (PDT) In-Reply-To: References: Date: Sun, 6 Apr 2014 09:16:42 -0700 Message-ID: Subject: Re: Best way to execute batch of queries From: James Taylor To: "user@phoenix.incubator.apache.org" Content-Type: multipart/alternative; boundary=20cf3011db9d92577f04f662134e X-Virus-Checked: Checked by ClamAV on apache.org --20cf3011db9d92577f04f662134e Content-Type: text/plain; charset=ISO-8859-1 Hi Amit, Would it be possible to post your CREATE TABLE statement, the EXPLAIN on the query, and the query itself so we can better diagnose any issues? >From your description above, you're executing the right query - it's always better to query for multiple rows versus executing a single query for each row (this is typically the case for any query engine). Batching is implemented in 2.2.3 and above, but not for performance reasons. Some products for which we have integration rely on a JDBC driver to support batching, so that's why it was added. Batching does not buy you anything in Phoenix, because it's an embedded JDBC driver. Thanks, James On Sun, Apr 6, 2014 at 9:08 AM, Amit Sela wrote: > Hi all, > I'm running with Phoenix 2.2.2 which (AFAIK) does not support batch > queries. > I want to query some (not all) of the columns in the table (all from the > same family), for multiple rowkeys. > Normally I would execute a batch queries of: > *select c1,c2... from table where rowkey=row1* > *select c1,c2... from table where rowkey=row2* > *...* > Since batch is not supported, I do the following: > *select c1,c2... from table where rowkey in (row1,row2...)* > > This ends up being slower than executing a batch of gets from the HBase > API... > > Is there a better way for me to use Phoenix in this case ? > > Thanks, > Amit. > > > --20cf3011db9d92577f04f662134e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Amit,
Would it be possible to post your CREATE TABL= E statement, the EXPLAIN on the query, and the query itself so we can bette= r diagnose any issues?

From your description above= , you're executing the right query - it's always better to query fo= r multiple rows versus executing a single query for each row (this is typic= ally the case for any query engine).

Batching is implemented in 2.2.3 and above, but not for= performance reasons. Some products for which we have integration rely on a= JDBC driver to support batching, so that's why it was added. Batching = does not buy you anything in Phoenix, because it's an embedded JDBC dri= ver.

Thanks,
James


On Sun, Apr 6, 2014 at 9:08 AM, A= mit Sela <amits@infolinks.com> wrote:
Hi all,=A0
I'm runn= ing with Phoenix 2.2.2 which (AFAIK) does not support batch queries.
<= div> I want to query some (not all) of the columns in the table (all from the sa= me family), for multiple rowkeys.
Normally I would execute a batch queries of:
se= lect c1,c2... from table where rowkey=3Drow1
select c1,c2.= .. from table where rowkey=3Drow2
...
Since batch is not supported, I do the following:
select = c1,c2... from table where rowkey in (row1,row2...)
This ends up being slower than executing a batch of gets fr= om the HBase API...

Is there a better way for me to use Phoenix in this cas= e ?

Thanks,
Amit.



--20cf3011db9d92577f04f662134e--