Thread: unreasonably slooooow query on small table from JDBC & Zeos

unreasonably slooooow query on small table from JDBC & Zeos

From
Muhammad Alsebaeyie
Date:
Hi,
I have a small database set up on a local TCP/IP network Linux server,
bandwidth is 10 MBit/s. I have a table X of around 6000 records( about
1.5MB) . On querying this table from either JDBC with database pooling
or Zeos database explorer (or interactive PGSQL)  from a win98 machine,(
as simple as select * from X),  the query is VERY slow, it may take up
to 15 mins. to execute. Eventhough psql executes it in afew seconds,
both local from the linux server and using telnet from another machine.
I vacuum the database regularly, and I have 2 versions of this table,
one with 3 indices and one with only 1 index on the primary key. they
both have the same problem. Any Ideas Why this Happens?

M. Alsebaeyie




Re: unreasonably slooooow query on small table from JDBC & Zeos

From
Peter Mount
Date:
On Sat, 14 Oct 2000, Muhammad Alsebaeyie wrote:

> Hi,
> I have a small database set up on a local TCP/IP network Linux server,
> bandwidth is 10 MBit/s. I have a table X of around 6000 records( about
> 1.5MB) . On querying this table from either JDBC with database pooling
> or Zeos database explorer (or interactive PGSQL)  from a win98 machine,(
> as simple as select * from X),  the query is VERY slow, it may take up
> to 15 mins. to execute. Eventhough psql executes it in afew seconds,
> both local from the linux server and using telnet from another machine.
> I vacuum the database regularly, and I have 2 versions of this table,
> one with 3 indices and one with only 1 index on the primary key. they
> both have the same problem. Any Ideas Why this Happens?

The problem with the current implementation of ResultSet is that it reads
the entire result into memory. Now this is the same to how libpq does it
(what psql uses), but Java suffers from having to convert all this data
from bytes into chars, and this is a major overhead.

Gunnar has recently done some work in optimising some of the overhead
being used, and it's in the cvs source if you want to try it.

If you have Java2 (JDK1.2 or later) there's a pre-beta binary on my web
site.

I've not done any testing of the current source from Windows yet, but when
we go into beta I'll be testing it from Win9x, ME, NT & 2K as well as
Linux.

Peter

-- 
Peter T Mount peter@retep.org.uk http://www.retep.org.uk
PostgreSQL JDBC Driver http://www.retep.org.uk/postgres/
Java PDF Generator http://www.retep.org.uk/pdf/