pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedTrying to Tunning DB
2+ messages / 2 participants
[nested] [flat]
* Trying to Tunning DB
@ 2003-04-05 14:01 Cristina Surroca <cris@dmcid.net>
0 siblings, 0 replies; 2+ messages in thread
From: Cristina Surroca @ 2003-04-05 14:01 UTC (permalink / raw)
To: pgsql-general@postgresql.org; pgsql-admin
Hi,
I'm doing a project and I've have some problems.
My table has (ID, atr1,..., atn), but there isn't any primary key because of the specifications, it's very similar to a Data warehouse, where every event is stored. It hasn't any delete, only inserts (more than 10^7) and many updates.
The thing is that it takes too much time in execute. (In my case, before each update I've to do select to find which row I have to modify, and I suppose it does a table scan. To improve it, I've thought to use a Btree for ID column).
I use JDBC. To make it works better, I use:
a.. Prepared Statements,
b.. setAutocommit(false), ( in my case I don't need transactions).
c.. I'm been reading PostgreSQL mailing list archive to try to discover other kinds of "tune", or how to improve it.
d.. I've also read FAQ and I've found "3.6) How do I tune the data base engine for better performance".
But in my case, would you think vacuum and analyze are good options? Can I do everything else? Can I also disable the catalog?
Thanks a lot
yours,
Cris..
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Trying to Tunning DB
@ 2003-04-08 03:50 Nikolaus Dilger <nikolaus@dilger.cc>
0 siblings, 0 replies; 2+ messages in thread
From: Nikolaus Dilger @ 2003-04-08 03:50 UTC (permalink / raw)
To: cris@dmcid.net; +Cc: pgsql-general@postgresql.org; pgsql-admin
Cris,
In order to improve your performance try
1) vacuum after inserting a significant amount of data
into your table.
2) Build an index on one or more of the columns used in
the WHERE clause when selecting what row to update.
Btree works best if the column has a high cardinality.
I.e. many different values.
Indexes have a performance penalty during inserts but
help during the select.
3) If you have enough RAM increase the number of shared
buffers.
Regards,
Nikolaus Dilger
"Cristina Surroca" wrote:
Hi,
I'm doing a
project and I've have some problems.
My table has (ID,
atr1,..., atn), but there isn't any primary key because
of the specifications,
it's very similar to a Data warehouse, where every
event is stored. It hasn't
any delete, only inserts (more than 10^7) and many
updates.
The thing is that
it takes too much time in execute. (In my case, before
each update I've to
do select to find which row I have to modify, and I
suppose it does a table
scan. To improve it, I've thought to use a Btree for ID
column).
I use JDBC. To
make it works better, I use:
Prepared
Statements,
setAutocommit(false),
( in my case I don't need transactions).
I'm been reading PostgreSQL
mailing list archive to try to discover other kinds
of "tune", or how
to improve it.
I've also read FAQ and I've found
"3.6) How do I tune the data base engine for better
performance".
But in my case,
would you think vacuum and analyze are good options?
Can I do everything else?
Can I also disable the catalog?
Thanks a lot
yours,
Cris..
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2003-04-08 03:50 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-04-05 14:01 Trying to Tunning DB Cristina Surroca <cris@dmcid.net>
2003-04-08 03:50 Re: Trying to Tunning DB Nikolaus Dilger <nikolaus@dilger.cc>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox