You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by Sumit Nigam <su...@yahoo.com> on 2015/09/15 06:13:43 UTC

Phoenix with PreparedStatement

Hello,

I am using Phoenix 4.5 with Hbase 0.98.1. 
PreparedStatement is preferred in case of say Oracle, etc. to help with effective use of query plans (with bind params). Does it also have same guarantees with Phoenix or does the Phoenix query engine treat both Statement and Prepared statement equally and I can use any of these with similar performance characteristics?
Thanks,Sumit

  

Re: Phoenix with PreparedStatement

Posted by Sumit Nigam <su...@yahoo.com>.
Thank you James. 
Will switch over to PreparedStatement. Interestingly, in some load tests, prepared statements did not offer any significant advantage. But as I understand, this is going to change soon.
Best regards,Sumit
      From: James Taylor <ja...@apache.org>
 To: user <us...@phoenix.apache.org> 
Cc: Sumit Nigam <su...@yahoo.com> 
 Sent: Tuesday, September 15, 2015 10:12 AM
 Subject: Re: Phoenix with PreparedStatement
   
Sumit,To add to what Samarth said, even now PreparedStatements help by saving the parsing cost. Soon, too, for UPDATE VALUES, we'll also avoid recompilation when using a PreparedStatement. I'd encourage you to use them.Thanks,James


On Mon, Sep 14, 2015 at 9:32 PM, Samarth Jain <sa...@apache.org> wrote:

Hi Sumit,
Phoenix doesn't cache query plans as of yet. Once we move over to Calcite parser and optimizer (which is a work in progress), we will hopefully start doing that which is when your suggested approach of using PreparedStatement with bind params would be beneficial.
- Samarth

On Mon, Sep 14, 2015 at 9:13 PM, Sumit Nigam <su...@yahoo.com> wrote:

Hello,

I am using Phoenix 4.5 with Hbase 0.98.1. 
PreparedStatement is preferred in case of say Oracle, etc. to help with effective use of query plans (with bind params). Does it also have same guarantees with Phoenix or does the Phoenix query engine treat both Statement and Prepared statement equally and I can use any of these with similar performance characteristics?
Thanks,Sumit

   





  

Re: Phoenix with PreparedStatement

Posted by James Heather <ja...@mendeley.com>.
UPDATE VALUES?

Was that a typo, or are we going to see true updates (as opposed to
upserts) coming to Phoenix?

James
On 15 Sep 2015 05:42, "James Taylor" <ja...@apache.org> wrote:

> Sumit,
> To add to what Samarth said, even now PreparedStatements help by saving
> the parsing cost. Soon, too, for UPDATE VALUES, we'll also avoid
> recompilation when using a PreparedStatement. I'd encourage you to use them.
> Thanks,
> James
>
> On Mon, Sep 14, 2015 at 9:32 PM, Samarth Jain <sa...@apache.org> wrote:
>
>> Hi Sumit,
>>
>> Phoenix doesn't cache query plans as of yet. Once we move over to Calcite
>> parser and optimizer (which is a work in progress), we will hopefully start
>> doing that which is when your suggested approach of using PreparedStatement
>> with bind params would be beneficial.
>>
>> - Samarth
>>
>> On Mon, Sep 14, 2015 at 9:13 PM, Sumit Nigam <su...@yahoo.com>
>> wrote:
>>
>>> Hello,
>>>
>>> I am using Phoenix 4.5 with Hbase 0.98.1.
>>>
>>> PreparedStatement is preferred in case of say Oracle, etc. to help with
>>> effective use of query plans (with bind params). Does it also have same
>>> guarantees with Phoenix or does the Phoenix query engine treat both
>>> Statement and Prepared statement equally and I can use any of these with
>>> similar performance characteristics?
>>>
>>> Thanks,
>>> Sumit
>>>
>>>
>>>
>>
>

Re: Phoenix with PreparedStatement

Posted by James Taylor <ja...@apache.org>.
Sumit,
To add to what Samarth said, even now PreparedStatements help by saving the
parsing cost. Soon, too, for UPDATE VALUES, we'll also avoid recompilation
when using a PreparedStatement. I'd encourage you to use them.
Thanks,
James

On Mon, Sep 14, 2015 at 9:32 PM, Samarth Jain <sa...@apache.org> wrote:

> Hi Sumit,
>
> Phoenix doesn't cache query plans as of yet. Once we move over to Calcite
> parser and optimizer (which is a work in progress), we will hopefully start
> doing that which is when your suggested approach of using PreparedStatement
> with bind params would be beneficial.
>
> - Samarth
>
> On Mon, Sep 14, 2015 at 9:13 PM, Sumit Nigam <su...@yahoo.com> wrote:
>
>> Hello,
>>
>> I am using Phoenix 4.5 with Hbase 0.98.1.
>>
>> PreparedStatement is preferred in case of say Oracle, etc. to help with
>> effective use of query plans (with bind params). Does it also have same
>> guarantees with Phoenix or does the Phoenix query engine treat both
>> Statement and Prepared statement equally and I can use any of these with
>> similar performance characteristics?
>>
>> Thanks,
>> Sumit
>>
>>
>>
>

Re: Phoenix with PreparedStatement

Posted by Samarth Jain <sa...@apache.org>.
Hi Sumit,

Phoenix doesn't cache query plans as of yet. Once we move over to Calcite
parser and optimizer (which is a work in progress), we will hopefully start
doing that which is when your suggested approach of using PreparedStatement
with bind params would be beneficial.

- Samarth

On Mon, Sep 14, 2015 at 9:13 PM, Sumit Nigam <su...@yahoo.com> wrote:

> Hello,
>
> I am using Phoenix 4.5 with Hbase 0.98.1.
>
> PreparedStatement is preferred in case of say Oracle, etc. to help with
> effective use of query plans (with bind params). Does it also have same
> guarantees with Phoenix or does the Phoenix query engine treat both
> Statement and Prepared statement equally and I can use any of these with
> similar performance characteristics?
>
> Thanks,
> Sumit
>
>
>