Re: Improving performance on multicolumn query

From: Jan Kesten <jan(dot)kesten(at)web(dot)de>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Improving performance on multicolumn query
Date: 2005-11-09 17:31:03
Message-ID: 43723257.5060804@web.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi all!

First thanks to any answer by now :-)

> You don't post your table definitions (please do), but it looks like
> test_b, test_c, test_d and test_e might be bigints? If so, you may
> want to do explicit "AND test_b=1::bigint AND test_c=2::bigint" etc.
> -- 7.4 doesn't figure this out for you. (8.0 and higher does.)

I didn't post table defintion, but you all are right, test_a to test_e
are all bigint. I use JDBC to connect to this database and use a
prepared statment for the queries and set all parameters with
pst.setLong() method. Perhaps this could be the problem? I'll try
'normal' statements with typecasting, because as far as I can see, the
query is the problem (postgresql takes more than 98% cpu while running
these statements) or the overhead produced (but not the network, as it
has only 1-2% load). Quering other tables (not as big - both rows and
columns are much less) run quite fast with the same code.

So, thanks again - I'll try and report :-) Can't be so slow, I have some
self-build database with millions of rows and they run very fast - but
they don't use bigint ;-)

Cheers,
Jan

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Ron Peacetree 2005-11-09 18:26:13 Re: Sort performance on large tables
Previous Message Charlie Savage 2005-11-09 17:13:46 Re: Sort performance on large tables