Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 797D564FD33 for ; Wed, 20 Aug 2008 12:03:11 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 84977-03-3 for ; Wed, 20 Aug 2008 12:02:57 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ti-out-0910.google.com (ti-out-0910.google.com [209.85.142.186]) by postgresql.org (Postfix) with ESMTP id E9B496502E3 for ; Wed, 20 Aug 2008 12:02:07 -0300 (ADT) Received: by ti-out-0910.google.com with SMTP id y8so370671tia.5 for ; Wed, 20 Aug 2008 08:02:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=/bvL3kwS9dtaYaaO29TNKyF+h0PgS72l7ilTmRN9fLk=; b=Fi+p4yle1NUTO6pzIFosF0TC4jiOV1DukzSjFXe7E5hK/1F8i/wf2Twc6MFOvNB8XI URxK8ldvGwiL3oonyx61mndgvCKYe5BXHcihpKBOZRUcFw6qk4uk8gOQrMHosJw8hSGy fKNPi1dzp7Jq0JCVec8gKQ+rjkNUHiJoEKfCM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=Gnwj6JQtdJWwUr3WoPzW/rIHXwArkpY7PfswatKVm+tD7K4WGAqIrbot1/z17GSA2U 2x1Irnp4Ftl+2naNuXDrEmpB6fvD8J3Hz9CtfHv+JFq1t4tBWk3PwuxL0lHiEa7FrX9S sUmD/bssoqqbgfMt150Csz5/dL9iApPwFnUCw= Received: by 10.110.31.5 with SMTP id e5mr180533tie.1.1219244525958; Wed, 20 Aug 2008 08:02:05 -0700 (PDT) Received: by 10.110.8.20 with HTTP; Wed, 20 Aug 2008 08:02:05 -0700 (PDT) Message-ID: <4478b4ac0808200802o12eee842ne98c9bee114e84e6@mail.gmail.com> Date: Wed, 20 Aug 2008 20:32:05 +0530 From: "=?WINDOWS-1252?Q?Kranti_K_K_Parisa=99?=" To: "Mark Lewis" Subject: Re: PostgreSQL+Hibernate Performance Cc: pgsql-performance@postgresql.org In-Reply-To: <1219242910.7023.94.camel@archimedes.mir3.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_86737_12759794.1219244525913" References: <4478b4ac0808200525ia6eabe8q886ac7fbba53ff05@mail.gmail.com> <1219242910.7023.94.camel@archimedes.mir3.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200808/218 X-Sequence-Number: 31099 ------=_Part_86737_12759794.1219244525913 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Mark, Thank you very much for the information. I will analyse the DB structure an= d create indexes on PG directly. Are you using any connection pooling like DBCP? or PG POOL? Regards, KP On Wed, Aug 20, 2008 at 8:05 PM, Mark Lewis wrote: > On Wed, 2008-08-20 at 17:55 +0530, Kranti K K Parisa=99 wrote: > > Hi, > > > > Can anyone suggest the performance tips for PostgreSQL using > > Hibernate. > > > > One of the queries: > > > > - PostgreSQL has INDEX concept and Hibernate also has Column INDEXes. > > Which is better among them? or creating either of them is enough? or > > need to create both of them? > > > > and any more performace aspects ? > > Hibernate is a library for accessing a database such as PostgreSQL. It > does not offer any add-on capabilities to the storage layer itself. So > when you tell Hibernate that a column should be indexed, all that it > does create the associated PostgreSQL index when you ask Hibernate to > build the DB tables for you. This is part of Hibernate's effort to > protect you from the implementation details of the underlying database, > in order to make supporting multiple databases with the same application > code easier. > > So there is no performance difference between a PG index and a Hibernate > column index, because they are the same thing. > > The most useful Hibernate performance-tuning advice isn't PG-specific at > all, there are just things that you need to keep in mind when developing > for any database to avoid pathologically bad performance; those tips are > really beyond the scope of this mailing list, Google is your friend > here. > > I've been the architect for an enterprise-class application for a few > years now using PostgreSQL and Hibernate together in a > performance-critical context, and honestly I can't think of one time > that I've been bitten by a PG-specific performance issue (a lot of > performance issues with Hibernate that affected all databases though; > you need to know what you're doing to make Hibernate apps that run fast. > If you do run into problems, you can figure out the actual SQL that > Hibernate is issuing and do the normal PostgreSQL explain analyze on it; > usually caused by a missing index. > > -- Mark > --=20 Best Regards Kranti Kiran Kumar Parisa M: +91 - 9391 - 438 - 738 +91 - 9849 - 625 - 625 ------=_Part_86737_12759794.1219244525913 Content-Type: text/html; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Hi Mark,

Thank you very much for the information. I= will analyse the DB structure and create indexes on PG directly.
Are yo= u using any connection pooling like DBCP? or PG POOL?

Regards, KP

On Wed, Aug 20, 2008 at 8:05 PM, Mark Le= wis <mark.lewis= @mir3.com> wrote:
On Wed, 2008-08-20 at 17:55 +0530, Kr= anti K K Parisa=99 wrote:
> Hi,
>
> Can anyone suggest the performance tips for PostgreSQL using
> Hibernate.
>
> One of the queries:
>
> - PostgreSQL has INDEX concept and Hibernate also has Column INDEXes.<= br> > Which is better among them? or creating either of them is enough? or > need to create both of them?
>
> and any more performace aspects ?

Hibernate is a library for accessing a database such as Postgre= SQL.  It
does not offer any add-on capabilities to the storage layer itself.  S= o
when you tell Hibernate that a column should be indexed, all that it
does create the associated PostgreSQL index when you ask Hibernate to
build the DB tables for you.  This is part of Hibernate's effort t= o
protect you from the implementation details of the underlying database,
in order to make supporting multiple databases with the same application code easier.

So there is no performance difference between a PG index and a Hibernate column index, because they are the same thing.

The most useful Hibernate performance-tuning advice isn't PG-specific a= t
all, there are just things that you need to keep in mind when developing for any database to avoid pathologically bad performance; those tips are really beyond the scope of this mailing list, Google is your friend
here.

I've been the architect for an enterprise-class application for a few years now using PostgreSQL and Hibernate together in a
performance-critical context, and honestly I can't think of one time that I've been bitten by a PG-specific performance issue (a lot of
performance issues with Hibernate that affected all databases though;
you need to know what you're doing to make Hibernate apps that run fast= .
If you do run into problems, you can figure out the actual SQL that
Hibernate is issuing and do the normal PostgreSQL explain analyze on it; usually caused by a missing index.

-- Mark



--

Best Regards=
Kranti Kiran Kumar Parisa
M: +91 - 9391 - 438 - 738
+91 - 9849 -= 625 - 625

------=_Part_86737_12759794.1219244525913--