Обсуждение: performance hit with large tables...jdbc?

Поиск
Список
Период
Сортировка

performance hit with large tables...jdbc?

От
Дата:
Hi all,

I'm running postgres 7.0.1 on Solaris 7 (on a Sparc II)
with Orionserver 1.3.11 as my web/application server.

I have a database with one really large table, about
7.4 million records, but each record is only about 208
characters.  During development, our test db was about
500,000 records and the performance was fine (under a second);
but now that we're going live with more data, we're suddenly
noticing that a select on the primary key field is taking
about 90 seconds.  However, if I go into the command line
on the db server and do the exact same SQL select manually,
it takes < 1 sec.  This makes me think it's some problem
with my JDBC driver, or some hardware between the web-server
and the db-server.

Is there anything else I might be overlooking?

ivan pushkey


Re: performance hit with large tables...jdbc?

От
Tom Lane
Дата:
<mikeg@robot6.com> writes:
> but now that we're going live with more data, we're suddenly
> noticing that a select on the primary key field is taking
> about 90 seconds.  However, if I go into the command line
> on the db server and do the exact same SQL select manually,
> it takes < 1 sec.  This makes me think it's some problem
> with my JDBC driver, or some hardware between the web-server
> and the db-server.

Hm.  Run the postmaster with -d2 so that queries are logged into
the postmaster log file, and see what query the client is really
sending.  I'll bet it's not what you think it is.

Another possibility is that there's some horrid inefficiency
in transmitting the query results, but unless this query is
returning a whole lot of data, that doesn't seem like it'd
explain 90 seconds.

            regards, tom lane