pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Performance problem
47+ messages / 30 participants
[nested] [flat]

* Performance problem
@ 2001-01-24 13:57  Andreas Rieke <andreas.rieke@isl-online.de>
  0 siblings, 1 reply; 47+ messages in thread

From: Andreas Rieke @ 2001-01-24 13:57 UTC (permalink / raw)
  To: kb@neuematerialien.de

Hi there,

maybe anyone can help me with the following problem.
Using PostgreSQL 7.03 on a Suse 6.3 Linux (kernel 2.2.13) with a P3/550
MHz,
I get a performance problem with a select command which takes up to 10
seconds.
The following tables are involved in this command:

CREATE TABLE "property_list" (
 "number" float8,
 "level_1_de" text,
 "level_1_en" text,
 "level_2_de" text,
 "level_2_en" text,

...

);

CREATE TABLE "properties" (
 "material_oid" oid NOT NULL,
 "property_list_oid" oid NOT NULL,

...

);

CREATE TABLE "materials" (
 "user_oid" oid NOT NULL,
 "material_class" oid,
 "is_new" bool DEFAULT 't'::bool,

...

);

and the command is

SELECT DISTINCT level_1_de from property_list pl, properties p,
materials m where m.oid=p.material_oid and p.property_list_oid=pl.oid
and m.is_new=FALSE;

The command returns about 10 items.
The tables mentioned contain the following number of entries:

materials: 2476
properties: 30 323
property_list: 349


I hope that using INDEXes should speed up the search, but although I
made
several attempts, the search is too slow. Since I am not an expert on
databases and PostgreSQL, maybe somebody who had similar problems is
able to help me.
Also, I do not know whether the DISTINCT in the SELECT statement forces
the database to
use algorithms which have not been optimized yet.

Thanks in advance for your help,

kind regards,

Andreas




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: Performance problem
@ 2001-01-24 19:34  Stephan Szabo <sszabo@megazone23.bigpanda.com>
  parent: Andreas Rieke <andreas.rieke@isl-online.de>
  0 siblings, 0 replies; 47+ messages in thread

From: Stephan Szabo @ 2001-01-24 19:34 UTC (permalink / raw)
  To: Andreas Rieke <andreas.rieke@isl-online.de>; +Cc: kb@neuematerialien.de; pgsql-general


Have you done a vacuum analyze on the database?  And what
does explain show for the query?

On Wed, 24 Jan 2001, Andreas Rieke wrote:

> 
> SELECT DISTINCT level_1_de from property_list pl, properties p,
> materials m where m.oid=p.material_oid and p.property_list_oid=pl.oid
> and m.is_new=FALSE;
> 
> The command returns about 10 items.
> The tables mentioned contain the following number of entries:
> 
> materials: 2476
> properties: 30 323
> property_list: 349
> 
> 
> I hope that using INDEXes should speed up the search, but although I
> made
> several attempts, the search is too slow. Since I am not an expert on
> databases and PostgreSQL, maybe somebody who had similar problems is
> able to help me.
> Also, I do not know whether the DISTINCT in the SELECT statement forces
> the database to
> use algorithms which have not been optimized yet.
> 
> Thanks in advance for your help,
> 
> kind regards,
> 
> Andreas
> 




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Performance-Problem
@ 2001-03-30 17:10  Konstantinos Agouros <elwood@agouros.de>
  0 siblings, 0 replies; 47+ messages in thread

From: elwood@agouros.de @ 2001-03-30 17:10 UTC (permalink / raw)
  To: pgsql-general

Hi,

I had the following problem: I have a table with around 5Mio entries.
I joined this table with a table with about 50 entries. Doing a insert into
another_table <my select-statement>. I am sure the select-statement might be
optimized but after 6 days of running I had to reboot the machine for other
reasons. The Machine is a 2CPU E250 Sun Sparc running 7.0.3.
Anybody has an idea (besides SQL-Tuning) how to get faster? Maybe take a look
at 7.1, since this is not a production database yet.
The SQL-Statement (yes I know I should post this, too, but I don't have access
to the script right now) was called from a perlscript using DBI/DBD and I have
set -F in the PGOPTIONS-parameter as well as AutoCommit to 0.

Konstantin
-- 
Dipl-Inf. Konstantin Agouros aka Elwood Blues. Internet: elwood@agouros.de
Otkerstr. 28, 81547 Muenchen, Germany. Tel +49 89 69370185
----------------------------------------------------------------------------
"Captain, this ship will not sustain the forming of the cosmos." B'Elana Torres



^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Performance Problem
@ 2003-03-12 14:27  Stefan Sturm <mailling@anrath.info>
  0 siblings, 3 replies; 47+ messages in thread

From: Stefan Sturm @ 2003-03-12 14:27 UTC (permalink / raw)
  To: pgsql-general

Hello,

we have a performance problem with PostgreSQL 7.2.4. But first I try to
explain our situation:

We have an online game. This game is a fantasy game, where you can buy
and sell players for your team.
All players for the teams are stored in one table. So in this table we
have just one primary key and to foreign keys.
When we have around 500 Users at one time on the maschine, the game is
slowing down(Time for one spage up to 1minute and more).  And I think
the problem is this table. There are a lot of reading and writing
connections to this table.

So now my question: What can I do to increase the performance? 

Thanks and greetings,

Stefan Sturmn




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: Performance Problem
@ 2003-03-12 14:57  Stephan Szabo <sszabo@megazone23.bigpanda.com>
  parent: Stefan Sturm <mailling@anrath.info>
  2 siblings, 0 replies; 47+ messages in thread

From: Stephan Szabo @ 2003-03-12 14:57 UTC (permalink / raw)
  To: Stefan Sturm <mailling@anrath.info>; +Cc: pgsql-general

On Wed, 12 Mar 2003, Stefan Sturm wrote:

> we have a performance problem with PostgreSQL 7.2.4. But first I try to
> explain our situation:
>
> We have an online game. This game is a fantasy game, where you can buy
> and sell players for your team.
> All players for the teams are stored in one table. So in this table we
> have just one primary key and to foreign keys.
> When we have around 500 Users at one time on the maschine, the game is
> slowing down(Time for one spage up to 1minute and more).  And I think
> the problem is this table. There are a lot of reading and writing
> connections to this table.
>
> So now my question: What can I do to increase the performance?

We'll need more information, like what kind of queries you're doing, to
give detailed answers, but as general questions:

Is that 500 simultaneous queries to the database?  What sort of real db
traffic are you seeing?  Are you analyzing frequently enough?  Are you
vacuuming enough?  What are the postgresql.conf settings (specifically
shared_buffers and sort_mem as a starting point)? What kind of query plans
are you getting for your queries (see explain analyze)?

It's possible that if you're doing lots of updates that you may be running
into concurrency problems with the foreign keys, but without knowing the
query mix (and examples) you're running, it's hard to say.




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: Performance Problem
@ 2003-03-12 16:31  Steve Crawford <scrawford@pinpointresearch.com>
  parent: Stefan Sturm <mailling@anrath.info>
  2 siblings, 0 replies; 47+ messages in thread

From: Steve Crawford @ 2003-03-12 16:31 UTC (permalink / raw)
  To: Stefan Sturm <mailling@anrath.info>; pgsql-general

Are you using the default settings in postgresql.conf? If so you will need to 
tinker with the memory settings such as shared_buffers (I've currently set 
mine to 1000 but am still learning and testing).

The default configuration is designed to ensure that postgres will start up 
on as many installations as possible. It is not configured for performance - 
that is left as an exercise for the DBA based on his/her individual 
requirements. Search the archives for lots of tips.

Cheers,
Steve


On Wednesday 12 March 2003 6:27 am, Stefan Sturm wrote:
> Hello,
>
> we have a performance problem with PostgreSQL 7.2.4. But first I try to
> explain our situation:
>
> We have an online game. This game is a fantasy game, where you can buy
> and sell players for your team.
> All players for the teams are stored in one table. So in this table we
> have just one primary key and to foreign keys.
> When we have around 500 Users at one time on the maschine, the game is
> slowing down(Time for one spage up to 1minute and more).  And I think
> the problem is this table. There are a lot of reading and writing
> connections to this table.
>
> So now my question: What can I do to increase the performance?
>
> Thanks and greetings,
>
> Stefan Sturmn
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org



^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: Performance Problem
@ 2003-03-12 17:28  scott.marlowe <scott.marlowe@ihs.com>
  parent: Stefan Sturm <mailling@anrath.info>
  2 siblings, 1 reply; 47+ messages in thread

From: scott.marlowe @ 2003-03-12 17:28 UTC (permalink / raw)
  To: Stefan Sturm <mailling@anrath.info>; +Cc: pgsql-general

On Wed, 12 Mar 2003, Stefan Sturm wrote:

> Hello,
> 
> we have a performance problem with PostgreSQL 7.2.4. But first I try to
> explain our situation:
> 
> We have an online game. This game is a fantasy game, where you can buy
> and sell players for your team.
> All players for the teams are stored in one table. So in this table we
> have just one primary key and to foreign keys.
> When we have around 500 Users at one time on the maschine, the game is
> slowing down(Time for one spage up to 1minute and more).  And I think
> the problem is this table. There are a lot of reading and writing
> connections to this table.
> 
> So now my question: What can I do to increase the performance? 

Hi Stefan, the first step to increasing performance is surveying the 
current situation.  When the machine starts to slow down, what does the 
output of top look like?  Is the machine running out of any resources like 
file handles or memory?  Note that most flavors of unix will not show a 
lot of memory free they will show it being used as cache.  If your machine 
shows 400 megs of system cache and postgresql is using 4 megs of shared 
memory, you aren't giving enough to postgresql.  It'll go slow.

If you allocate too much memory for certain things (sort_mem is a 
notorious gotcha for performance tuners) then you might allocate all your 
memory and start using swap.  It'll go slow then too.

So it's about finding the sweet spot.

What's in your postgresql.conf file?
What's your kernel's shm and max files / inodes type stuff set to?
How much memory does your machine have?
What kinds of queries are you running?
Are you reconnecting in your script or using a single connection?
Are you pooling connections?
Are you running lots of updates in autocommit that belong together 
inside one transaction?  It's much faster to put em together.




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: Performance Problem
@ 2003-03-12 23:21  Stephen Robert Norris <srn@commsecure.com.au>
  parent: scott.marlowe <scott.marlowe@ihs.com>
  0 siblings, 0 replies; 47+ messages in thread

From: Stephen Robert Norris @ 2003-03-12 23:21 UTC (permalink / raw)
  To: scott.marlowe <scott.marlowe@ihs.com>; +Cc: Stefan Sturm <mailling@anrath.info>; pgsql-general

On Thu, 2003-03-13 at 04:28, scott.marlowe wrote:
> On Wed, 12 Mar 2003, Stefan Sturm wrote:
> 
> > Hello,
> > 
> > we have a performance problem with PostgreSQL 7.2.4. But first I try to
> > explain our situation:
> > 
> > We have an online game. This game is a fantasy game, where you can buy
> > and sell players for your team.
> > All players for the teams are stored in one table. So in this table we
> > have just one primary key and to foreign keys.
> > When we have around 500 Users at one time on the maschine, the game is
> > slowing down(Time for one spage up to 1minute and more).  And I think
> > the problem is this table. There are a lot of reading and writing
> > connections to this table.
> > 
> > So now my question: What can I do to increase the performance? 
> 
> Hi Stefan, the first step to increasing performance is surveying the 
> current situation.  When the machine starts to slow down, what does the 
> output of top look like?  Is the machine running out of any resources like 
> file handles or memory?  Note that most flavors of unix will not show a 
> lot of memory free they will show it being used as cache.  If your machine 
> shows 400 megs of system cache and postgresql is using 4 megs of shared 
> memory, you aren't giving enough to postgresql.  It'll go slow.

To add to what Scott says, what does vmstat report (are you swapping?).
If you're not already, install sar and see how much I/O and CPU you're
consuming - one important issue is whether you're running out of I/O
capacity or CPU or RAM.

	Stephen

Attachments:

  signature.asc (application/pgp-signature, 188B) download

^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Performance Problem
@ 2003-04-16 01:40  Pedro C. Arias <parias@unr.edu.ar>
  0 siblings, 2 replies; 47+ messages in thread

From: Pedro C. Arias @ 2003-04-16 01:40 UTC (permalink / raw)
  To: pgsql-general

Hello, i use PostgresSQL 7.3.2 on Mandrake 9.0, I create a Database to test performance vs. SQL-Server, the idea is migrate SQL-Server to Postgres.
This test is retrieve a table sorted by a field ie: "select * from test order by id_field asc", postgress retrieve it in 43 seconds and SQL-Server in 8 seconds
The table has 100.000 records, why the diference, how acelerete the performance of postgres, have any tutorial on the web to optimize querys ?

Pedro
Rosario-Argentina

^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: Performance Problem
@ 2003-04-16 01:51  Stephan Szabo <sszabo@megazone23.bigpanda.com>
  parent: Pedro C. Arias <parias@unr.edu.ar>
  1 sibling, 0 replies; 47+ messages in thread

From: Stephan Szabo @ 2003-04-16 01:51 UTC (permalink / raw)
  To: Pedro C. Arias <parias@unr.edu.ar>; +Cc: pgsql-general


On Tue, 15 Apr 2003, Pedro C. Arias wrote:

> Hello, i use PostgresSQL 7.3.2 on Mandrake 9.0, I create a Database to
> test performance vs. SQL-Server, the idea is migrate SQL-Server to
> Postgres. This test is retrieve a table sorted by a field ie: "select
> * from test order by id_field asc", postgress retrieve it in 43
> seconds and SQL-Server in 8 seconds The table has 100.000 records, why
> the diference, how acelerete the performance of postgres, have any
> tutorial on the web to optimize querys ?

What is the definition of test and what indexes does it have and what does
explain show for the query above?  If you haven't at least vacuumed or
analyzed the table it's likely running on the default statistics which is
probably not good, also you may want/need to look at raising sort_mem if
the sort is going out to disk.




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: Performance Problem
@ 2003-04-16 06:59  Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
  parent: Pedro C. Arias <parias@unr.edu.ar>
  1 sibling, 0 replies; 47+ messages in thread

From: Shridhar Daithankar @ 2003-04-16 06:59 UTC (permalink / raw)
  To: pgsql-general

On Wednesday 16 April 2003 07:10, Pedro C. Arias wrote:
> Hello, i use PostgresSQL 7.3.2 on Mandrake 9.0, I create a Database to test
> performance vs. SQL-Server, the idea is migrate SQL-Server to Postgres.
> This test is retrieve a table sorted by a field ie: "select * from test
> order by id_field asc", postgress retrieve it in 43 seconds and SQL-Server
> in 8 seconds The table has 100.000 records, why the diference, how
> acelerete the performance of postgres, have any tutorial on the web to
> optimize querys ?

There are too many variables to tune for. To start with, tune postgresql.conf. 
Look for number of shared buffers and sort mem. Also vacuum periodically.

 More specific information would help.

 Shridhar




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Performance Problem
@ 2003-05-12 13:57  Adam Sherman <adam@tritus.ca>
  0 siblings, 1 reply; 47+ messages in thread

From: Adam Sherman @ 2003-05-12 13:57 UTC (permalink / raw)
  To: pgsql-general

I am trying to isolate a performance problem I'm having.

I have some code that does something like this, iterating through a list:


BEGIN
while(list)
lookup for existing entry (SELECT)
if not, INSERT
if yes, UPDATE
log a message
COMMIT

With approx. 30K items the process takes way too long. On the order of 10+ 
minutes.

I notice that the process seems to slow down as it completes more and more 
items. ie, the first 10K takes just a few moments while the last 10K takes 
most of the time. Note that I'm running test where the only existing 
entries will have been inserted in the same transaction.

I need to know if the bottleneck is PG or higher up so I can go hunting 
there.

Thanks,

A.

--
Adam Sherman
Tritus CG Inc.
http://www.tritus.ca/
+1 (613) 797-6819




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: Performance Problem
@ 2003-05-12 15:42  Bruno Wolff III <bruno@wolff.to>
  parent: Adam Sherman <adam@tritus.ca>
  0 siblings, 1 reply; 47+ messages in thread

From: Bruno Wolff III @ 2003-05-12 15:42 UTC (permalink / raw)
  To: Adam Sherman <adam@tritus.ca>; +Cc: pgsql-general

On Mon, May 12, 2003 at 09:57:12 -0400,
  Adam Sherman <adam@tritus.ca> wrote:
> 
> BEGIN
> while(list)
> lookup for existing entry (SELECT)
> if not, INSERT
> if yes, UPDATE
> log a message
> COMMIT
> 
> With approx. 30K items the process takes way too long. On the order of 10+ 
> minutes.
> 
> I notice that the process seems to slow down as it completes more and more 
> items. ie, the first 10K takes just a few moments while the last 10K takes 
> most of the time. Note that I'm running test where the only existing 
> entries will have been inserted in the same transaction.
> 
> I need to know if the bottleneck is PG or higher up so I can go hunting 
> there.

Are there deferred constraints? They are still order n squared. Some
fixes went in to 7.3 but the last order n squared issue wasn't fixed
until 7.4. There was some discussion of back porting the fix to 7.3.3
(which might be available in about a month) but I am not sure whether
or that is going to happen.




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: Performance Problem
@ 2003-05-12 17:01  Adam Sherman <adam@tritus.ca>
  parent: Bruno Wolff III <bruno@wolff.to>
  0 siblings, 1 reply; 47+ messages in thread

From: Adam Sherman @ 2003-05-12 17:01 UTC (permalink / raw)
  To: Bruno Wolff III <bruno@wolff.to>; +Cc: pgsql-general

On 05/12/03 10:42:43 -0500 Bruno Wolff III wrote:

> Are there deferred constraints? They are still order n squared. Some
> fixes went in to 7.3 but the last order n squared issue wasn't fixed
> until 7.4. There was some discussion of back porting the fix to 7.3.3
> (which might be available in about a month) but I am not sure whether
> or that is going to happen.

Ah, over my head now. I don't think any of the constraints are deferred...

Thanks,

A.

--
Adam Sherman
Tritus CG Inc.
http://www.tritus.ca/
+1 (613) 797-6819




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: Performance Problem
@ 2003-05-12 23:18  Joseph Shraibman <jks@selectacast.net>
  parent: Adam Sherman <adam@tritus.ca>
  0 siblings, 1 reply; 47+ messages in thread

From: Joseph Shraibman @ 2003-05-12 23:18 UTC (permalink / raw)
  To: Adam Sherman <adam@tritus.ca>; +Cc: Bruno Wolff III <bruno@wolff.to>; pgsql-general

Are you using jdbc by any chance?

-- 
Joseph Shraibman
joseph@xtenit.com
Increase signal to noise ratio.  http://xis.xtenit.com




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: Performance Problem
@ 2003-05-12 23:41  Adam Sherman <adam@tritus.ca>
  parent: Joseph Shraibman <jks@selectacast.net>
  0 siblings, 1 reply; 47+ messages in thread

From: Adam Sherman @ 2003-05-12 23:41 UTC (permalink / raw)
  To: Joseph Shraibman <jks@selectacast.net>; +Cc: pgsql-general

On 05/12/03 19:18:13 -0400 Joseph Shraibman wrote:

> Are you using jdbc by any chance?

Uh oh. Yes, I am using JDBC. )-:

A.

--
Adam Sherman
Tritus CG Inc.
http://www.tritus.ca/
+1 (613) 797-6819




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: Performance Problem
@ 2003-05-13 00:18  Joseph Shraibman <jks@selectacast.net>
  parent: Adam Sherman <adam@tritus.ca>
  0 siblings, 0 replies; 47+ messages in thread

From: Joseph Shraibman @ 2003-05-13 00:18 UTC (permalink / raw)
  To: Adam Sherman <adam@tritus.ca>; +Cc: pgsql-general

I was having a similar probelm.  Turns out there were a bunch of warnings that kept being 
added to the Connection.  Try explicitly clearing the connection warnings.  The jdbc 
drivers in the cvs add the warnings to the Statement, not the Connecton.

Adam Sherman wrote:
> On 05/12/03 19:18:13 -0400 Joseph Shraibman wrote:
> 
>> Are you using jdbc by any chance?
> 
> 
> Uh oh. Yes, I am using JDBC. )-:
> 




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* performance problem
@ 2003-11-18 20:43  Rick Gigger <rick@alpinenetworking.com>
  0 siblings, 3 replies; 47+ messages in thread

From: Rick Gigger @ 2003-11-18 20:43 UTC (permalink / raw)
  To: pgsql-general

I am currently trying to import a text data file without about 45,000
records.  At the end of the import it does an update on each of the 45,000
records.  Doing all of the inserts completes in a fairly short amount of
time (about 2 1/2 minutes).  Once it gets to the the updates though it slows
to a craw.  After about 10 minutes it's only done about 3000 records.

Is that normal?  Is it because it's inside such a large transaction?  Is
there anything I can do to speed that up.  It seems awfully slow to me.

I didn't think that giving it more shared buffers would help but I tried
anyway.  It didn't help.

I tried doing a analyze full on it (vacuumdb -z -f) and it cleaned up a lot
of stuff but it didn't speed up the updates at all.

I am using a dual 800mhz xeon box with 2 gb of ram.  I've tried anywhere
from about 16,000 to 65000 shared buffers.

What other factors are involved here?




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-18 21:03  Mike Mascari <mascarm@mascari.com>
  parent: Rick Gigger <rick@alpinenetworking.com>
  2 siblings, 1 reply; 47+ messages in thread

From: Mike Mascari @ 2003-11-18 21:03 UTC (permalink / raw)
  To: Rick Gigger <rick@alpinenetworking.com>; +Cc: pgsql-general

Rick Gigger wrote:

> I am currently trying to import a text data file without about 45,000
> records.  At the end of the import it does an update on each of the 45,000
> records.  Doing all of the inserts completes in a fairly short amount of
> time (about 2 1/2 minutes).  Once it gets to the the updates though it slows
> to a craw.  After about 10 minutes it's only done about 3000 records.
> 
> Is that normal?  Is it because it's inside such a large transaction?  Is
> there anything I can do to speed that up.  It seems awfully slow to me.
> 
> I didn't think that giving it more shared buffers would help but I tried
> anyway.  It didn't help.
> 
> I tried doing a analyze full on it (vacuumdb -z -f) and it cleaned up a lot
> of stuff but it didn't speed up the updates at all.
> 
> I am using a dual 800mhz xeon box with 2 gb of ram.  I've tried anywhere
> from about 16,000 to 65000 shared buffers.
> 
> What other factors are involved here?

It is difficult to say without knowing either the definition of the
relation(s) or the update queries involved. Are there indexes being
created after the import that would allow PostgreSQL to locate the
rows being updated quickly, or is the update an unqualified update (no
WHERE clause) that affects all tuples?

EXPLAIN ANALYZE is your friend...

Mike Mascari
mascarm@mascari.com





^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-18 21:11  Dann Corbit <DCorbit@connx.com>
  0 siblings, 0 replies; 47+ messages in thread

From: Dann Corbit @ 2003-11-18 21:11 UTC (permalink / raw)
  To: Rick Gigger <rick@alpinenetworking.com>; pgsql-general

> -----Original Message-----
> From: Rick Gigger [mailto:rick@alpinenetworking.com] 
> Sent: Tuesday, November 18, 2003 12:43 PM
> To: PgSQL General ML
> Subject: [GENERAL] performance problem
> 
> 
> I am currently trying to import a text data file without 
> about 45,000 records.  At the end of the import it does an 
> update on each of the 45,000 records.  Doing all of the 
> inserts completes in a fairly short amount of time (about 2 
> 1/2 minutes).  Once it gets to the the updates though it 
> slows to a craw.  After about 10 minutes it's only done about 
> 3000 records.
> 
> Is that normal?  

No way to know, from what you have told us.

> Is it because it's inside such a large 
> transaction?  Is there anything I can do to speed that up.  
> It seems awfully slow to me.
> 
> I didn't think that giving it more shared buffers would help 
> but I tried anyway.  It didn't help.
> 
> I tried doing a analyze full on it (vacuumdb -z -f) and it 
> cleaned up a lot of stuff but it didn't speed up the updates at all.
> 
> I am using a dual 800mhz xeon box with 2 gb of ram.  I've 
> tried anywhere from about 16,000 to 65000 shared buffers.
> 
> What other factors are involved here?

What is the structure of the tables?  What sort of indexes are involved?
Is the query using a prepared statement?  Can you perform the entire
update in a single SQL statement?  What is the cardinality of the tables
involved?

Provide your exact code that you use to perform the update.

Provide the SQL schema for the every table used in the queries.

Perform an analyze for the query that is slow.  What does it say?



^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-18 21:24  scott.marlowe <scott.marlowe@ihs.com>
  parent: Rick Gigger <rick@alpinenetworking.com>
  2 siblings, 1 reply; 47+ messages in thread

From: scott.marlowe @ 2003-11-18 21:24 UTC (permalink / raw)
  To: Rick Gigger <rick@alpinenetworking.com>; +Cc: pgsql-general

On Tue, 18 Nov 2003, Rick Gigger wrote:

> I am currently trying to import a text data file without about 45,000
> records.  At the end of the import it does an update on each of the 45,000
> records.  Doing all of the inserts completes in a fairly short amount of
> time (about 2 1/2 minutes).  Once it gets to the the updates though it slows
> to a craw.  After about 10 minutes it's only done about 3000 records.

Are you doing your updates like this:

update table1 set field1='1' where id=1;
update table1 set field2=4 where id=1;
...
update table1 set field10='something else' where id=1;
update table1 set field1='3' where id=2;
...

Maybe an analyze after the import and before the updates would help.  As 
might a vacuum [full].  If the table isn't updated by other processes 
probably not.

Maybe you've got a foreign key mistmatch going on and a lot of sequential 
scanning?

> Is that normal?  Is it because it's inside such a large transaction?  Is
> there anything I can do to speed that up.  It seems awfully slow to me.

Possibly.  If you are creating a lot of dead tuples, then the operations 
can get slower and slower.  Have you checked your fsm settings et. al.?

> I didn't think that giving it more shared buffers would help but I tried
> anyway.  It didn't help.

Usually doesn't.  More sort_mem might though.  Make it something like 
16384 or 32768 (it's measured in kbytes)

> I tried doing a analyze full on it (vacuumdb -z -f) and it cleaned up a lot
> of stuff but it didn't speed up the updates at all.

You need to probably do the analyze between the import and the update.

> I am using a dual 800mhz xeon box with 2 gb of ram.  I've tried anywhere
> from about 16,000 to 65000 shared buffers.

That's VERY high.  When postgresql has to manage a lot of buffers it 
actually is slower than letting the kernel in Linux or BSD do it for you.

> What other factors are involved here?

Not sure.  More concrete examples would help.  Have you run your queries 
with explain analyze at the front and looked for differences in number of 
rows / loops?  Those are the dead giveaways.

Take a look here:

http://www.varlena.com/varlena/GeneralBits/Tidbits/perf.html




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-18 21:41  Rick Gigger <rick@alpinenetworking.com>
  parent: Mike Mascari <mascarm@mascari.com>
  0 siblings, 1 reply; 47+ messages in thread

From: Rick Gigger @ 2003-11-18 21:41 UTC (permalink / raw)
  To: Mike Mascari <mascarm@mascari.com>; +Cc: pgsql-general

Uh, I feel a little silly now.  I had and index on the field in question
(needed to locate the row to update) but later recreated the table and
forgot to readd it.  I had assumed that it was there but double checked just
now and it was gone.  I then readded the index and and it finished in a few
minutes.
Sorry about that one.  Thanks for the help.

rg

----- Original Message ----- 
From: "Mike Mascari" <mascarm@mascari.com>
To: "Rick Gigger" <rick@alpinenetworking.com>
Cc: "PgSQL General ML" <pgsql-general@postgresql.org>
Sent: Tuesday, November 18, 2003 2:03 PM
Subject: Re: [GENERAL] performance problem


> Rick Gigger wrote:
>
> > I am currently trying to import a text data file without about 45,000
> > records.  At the end of the import it does an update on each of the
45,000
> > records.  Doing all of the inserts completes in a fairly short amount of
> > time (about 2 1/2 minutes).  Once it gets to the the updates though it
slows
> > to a craw.  After about 10 minutes it's only done about 3000 records.
> >
> > Is that normal?  Is it because it's inside such a large transaction?  Is
> > there anything I can do to speed that up.  It seems awfully slow to me.
> >
> > I didn't think that giving it more shared buffers would help but I tried
> > anyway.  It didn't help.
> >
> > I tried doing a analyze full on it (vacuumdb -z -f) and it cleaned up a
lot
> > of stuff but it didn't speed up the updates at all.
> >
> > I am using a dual 800mhz xeon box with 2 gb of ram.  I've tried anywhere
> > from about 16,000 to 65000 shared buffers.
> >
> > What other factors are involved here?
>
> It is difficult to say without knowing either the definition of the
> relation(s) or the update queries involved. Are there indexes being
> created after the import that would allow PostgreSQL to locate the
> rows being updated quickly, or is the update an unqualified update (no
> WHERE clause) that affects all tuples?
>
> EXPLAIN ANALYZE is your friend...
>
> Mike Mascari
> mascarm@mascari.com
>
>
>




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-18 21:50  Martin Marques <martin@bugs.unl.edu.ar>
  parent: Rick Gigger <rick@alpinenetworking.com>
  2 siblings, 0 replies; 47+ messages in thread

From: Martin Marques @ 2003-11-18 21:50 UTC (permalink / raw)
  To: Rick Gigger <rick@alpinenetworking.com>; pgsql-general

El Mar 18 Nov 2003 17:43, Rick Gigger escribió:
> I am currently trying to import a text data file without about 45,000
> records.  At the end of the import it does an update on each of the 45,000
> records.  Doing all of the inserts completes in a fairly short amount of
> time (about 2 1/2 minutes).  Once it gets to the the updates though it slows
> to a craw.  After about 10 minutes it's only done about 3000 records.

Thats not a big amount of rows. It shouldn't be making that amount of trouble, 
unless you have something wrong with the update query.

Try inserting all the 45K rows and then run an explain analyze to the update 
query to see what's wrong (reply the output of explain analyze to the list). 
The update query itself would help alot, too.

> Is that normal?  Is it because it's inside such a large transaction?  Is
> there anything I can do to speed that up.  It seems awfully slow to me.

Not sure, but I have had lot's of big transactions with heady load, and never 
had a problem like the one you describe.

> I didn't think that giving it more shared buffers would help but I tried
> anyway.  It didn't help.
> 
> I tried doing a analyze full on it (vacuumdb -z -f) and it cleaned up a lot
> of stuff but it didn't speed up the updates at all.
> 
> I am using a dual 800mhz xeon box with 2 gb of ram.  I've tried anywhere
> from about 16,000 to 65000 shared buffers.

How's memory performace while you're running the updates? What does free say 
(if you are in some unix environment).

-- 
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
-----------------------------------------------------------------
Martín Marqués                  |        mmarques@unl.edu.ar
Programador, Administrador, DBA |       Centro de Telemática
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-18 23:54  Rick Gigger <rick@alpinenetworking.com>
  parent: scott.marlowe <scott.marlowe@ihs.com>
  0 siblings, 2 replies; 47+ messages in thread

From: Rick Gigger @ 2003-11-18 23:54 UTC (permalink / raw)
  To: scott.marlowe <scott.marlowe@ihs.com>; +Cc: pgsql-general

> Usually doesn't.  More sort_mem might though.  Make it something like
> 16384 or 32768 (it's measured in kbytes)

I thought that it was measured in 8k blocks.

http://candle.pha.pa.us/main/writings/pgsql/hw_performance/node3.html


> That's VERY high.  When postgresql has to manage a lot of buffers it
> actually is slower than letting the kernel in Linux or BSD do it for you.

Even if you've got the memory to spare?  Does postgres actually slow down
just because it's slower to manager a lot of them just or because you're
taking the memory away from the kernel so the kernel has to swap more?

rg




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-19 02:25  Doug McNaught <doug@mcnaught.org>
  parent: Rick Gigger <rick@alpinenetworking.com>
  1 sibling, 1 reply; 47+ messages in thread

From: Doug McNaught @ 2003-11-19 02:25 UTC (permalink / raw)
  To: Rick Gigger <rick@alpinenetworking.com>; +Cc: scott.marlowe <scott.marlowe@ihs.com>; pgsql-general

"Rick Gigger" <rick@alpinenetworking.com> writes:

> > That's VERY high.  When postgresql has to manage a lot of buffers it
> > actually is slower than letting the kernel in Linux or BSD do it for you.
> 
> Even if you've got the memory to spare?  Does postgres actually slow down
> just because it's slower to manager a lot of them just or because you're
> taking the memory away from the kernel so the kernel has to swap more?

The latter, mainly, I think.  Also you *really* don't want your kernel
to swap out any of your shared buffers, which can happen if they take
up a significant portion of RAM...

-Doug



^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-19 02:30  Martijn van Oosterhout <kleptog@svana.org>
  parent: Rick Gigger <rick@alpinenetworking.com>
  1 sibling, 0 replies; 47+ messages in thread

From: Martijn van Oosterhout @ 2003-11-19 02:30 UTC (permalink / raw)
  To: Rick Gigger <rick@alpinenetworking.com>; +Cc: scott.marlowe <scott.marlowe@ihs.com>; pgsql-general

On Tue, Nov 18, 2003 at 04:54:59PM -0700, Rick Gigger wrote:
> > That's VERY high.  When postgresql has to manage a lot of buffers it
> > actually is slower than letting the kernel in Linux or BSD do it for you.
> 
> Even if you've got the memory to spare?  Does postgres actually slow down
> just because it's slower to manager a lot of them just or because you're
> taking the memory away from the kernel so the kernel has to swap more?

It's a combination. Any buffer that's stored in the postgresql cache is also
in the kernel cache so that's just slightly inefficient. The kernel pool
manager tends to be more optimised for handling large numbers of buffers.
Because it's the kernel is can tailor for hardware quirks like high memory
and bounce buffers and such. And when you're not using your shared memory
it's wasted but the kernel can reallocate any memory it likes for any
purpose.

Hope this helps,
-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> "All that is needed for the forces of evil to triumph is for enough good
> men to do nothing." - Edmond Burke
> "The penalty good people pay for not being interested in politics is to be
> governed by people worse than themselves." - Plato

^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-20 20:41  Rick Gigger <rick@alpinenetworking.com>
  parent: Doug McNaught <doug@mcnaught.org>
  0 siblings, 3 replies; 47+ messages in thread

From: Rick Gigger @ 2003-11-20 20:41 UTC (permalink / raw)
  To: Doug McNaught <doug@mcnaught.org>; +Cc: scott.marlowe <scott.marlowe@ihs.com>; pgsql-general

> > > That's VERY high.  When postgresql has to manage a lot of buffers it
> > > actually is slower than letting the kernel in Linux or BSD do it for
you.

I am confused.  In this tutorial (by Bruce Momjian)
http://candle.pha.pa.us/main/writings/pgsql/hw_performance/node8.html
it says: "As a start for tuning, use 25% of RAM for cache size, and 2-4% for
sort size."

If I've got 2g of RAM then that is 2097152k.  25% of that = 524288k.  So the
tutorial is saying that 524288k is a good starting point for shared buffers
with this amount of RAM.

If each buffer is 8k
(http://candle.pha.pa.us/main/writings/pgsql/hw_performance/node3.html)
then that would be 65536 buffers.

I'm pretty sure that that is a lot more than I need to cache every tuple in
my database.  Now everytime I see someone comment on this list about
appropriate numbers for shared buffers they say something like "(65536
buffers is) VERY high.  Now since I obviously don't need that much shared
cache so I am not concerned but it seems to me that one of the following
must be true.

My calculations here are wrong.
or The tutorial is not accurate in saying that 25% is a good starting point.
or The people making comments that 65536 is "VERY high" are wrong.

Am I just confused or does this make sense?

> > Even if you've got the memory to spare?  Does postgres actually slow
down
> > just because it's slower to manager a lot of them just or because you're
> > taking the memory away from the kernel so the kernel has to swap more?
>
> The latter, mainly, I think.  Also you *really* don't want your kernel
> to swap out any of your shared buffers, which can happen if they take
> up a significant portion of RAM...

So if I'm not swapping at all and I've got over 1g of unused memory then I'm
probably ok even with the very high buffer setting? (Although I will
probably reduce it anyway since it is unnecessary).

rg




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-20 20:52  Rick Gigger <rick@alpinenetworking.com>
  parent: Rick Gigger <rick@alpinenetworking.com>
  0 siblings, 2 replies; 47+ messages in thread

From: Rick Gigger @ 2003-11-20 20:52 UTC (permalink / raw)
  To: Rick Gigger <rick@alpinenetworking.com>; Mike Mascari <mascarm@mascari.com>; +Cc: pgsql-general

Ok, adding the index back in worked the first time but then I tried
generating the database from scratch again, this time adding the index right
from the start.  It added the 45000 rows in about a minute but then was
going dog slow on the updates again.  So I did an explain and sure enough it
was not using the index.  After some investigation I determined that it was
not using the index because when the transaction started there were only 4
rows in the table so at that point it didn't want to use it.  It apparently
doesn't gather analysis data fast enough to handle this kind of transaction.

I worked around this by starting the transaction and inserting the 45,000
rows and then killing it.  The I removed the index and readded it which
apparently gathered some stats and since there were all of the dead tuples
in there from the failed transaction it now decided that it should use the
index.  I reran the script and this time it took 5 minutes again instead of
1 1/2 hours.

I am using 7.2.4.  Has this improved in later versions?  I'm not concerened
since this is a very rare thing to need to do and it's obviously possible to
work around but it would be nice if postgres could figure things like that
out on it's own.  (It certainly would have saved me a lot of time and
confusion last night at about 3 am).  Is there a way to for the use of a
specific index on a query?

rg

----- Original Message ----- 
From: "Rick Gigger" <rick@alpinenetworking.com>
To: "Mike Mascari" <mascarm@mascari.com>
Cc: "PgSQL General ML" <pgsql-general@postgresql.org>
Sent: Tuesday, November 18, 2003 2:41 PM
Subject: Re: [GENERAL] performance problem


> Uh, I feel a little silly now.  I had and index on the field in question
> (needed to locate the row to update) but later recreated the table and
> forgot to readd it.  I had assumed that it was there but double checked
just
> now and it was gone.  I then readded the index and and it finished in a
few
> minutes.
> Sorry about that one.  Thanks for the help.
>
> rg
>
> ----- Original Message ----- 
> From: "Mike Mascari" <mascarm@mascari.com>
> To: "Rick Gigger" <rick@alpinenetworking.com>
> Cc: "PgSQL General ML" <pgsql-general@postgresql.org>
> Sent: Tuesday, November 18, 2003 2:03 PM
> Subject: Re: [GENERAL] performance problem
>
>
> > Rick Gigger wrote:
> >
> > > I am currently trying to import a text data file without about 45,000
> > > records.  At the end of the import it does an update on each of the
> 45,000
> > > records.  Doing all of the inserts completes in a fairly short amount
of
> > > time (about 2 1/2 minutes).  Once it gets to the the updates though it
> slows
> > > to a craw.  After about 10 minutes it's only done about 3000 records.
> > >
> > > Is that normal?  Is it because it's inside such a large transaction?
Is
> > > there anything I can do to speed that up.  It seems awfully slow to
me.
> > >
> > > I didn't think that giving it more shared buffers would help but I
tried
> > > anyway.  It didn't help.
> > >
> > > I tried doing a analyze full on it (vacuumdb -z -f) and it cleaned up
a
> lot
> > > of stuff but it didn't speed up the updates at all.
> > >
> > > I am using a dual 800mhz xeon box with 2 gb of ram.  I've tried
anywhere
> > > from about 16,000 to 65000 shared buffers.
> > >
> > > What other factors are involved here?
> >
> > It is difficult to say without knowing either the definition of the
> > relation(s) or the update queries involved. Are there indexes being
> > created after the import that would allow PostgreSQL to locate the
> > rows being updated quickly, or is the update an unqualified update (no
> > WHERE clause) that affects all tuples?
> >
> > EXPLAIN ANALYZE is your friend...
> >
> > Mike Mascari
> > mascarm@mascari.com
> >
> >
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-20 20:59  fred@redhotpenguin.com
  parent: Rick Gigger <rick@alpinenetworking.com>
  2 siblings, 1 reply; 47+ messages in thread

From: fred@redhotpenguin.com @ 2003-11-20 20:59 UTC (permalink / raw)
  To: Rick Gigger <rick@alpinenetworking.com>; +Cc: Doug McNaught <doug@mcnaught.org>; scott.marlowe <scott.marlowe@ihs.com>; pgsql-general

As discussed on previous posts and mentioned below, the kernel is often
better at handling large amounts of buffers than Postgres.



^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-20 21:06  Alvaro Herrera Munoz <alvherre@dcc.uchile.cl>
  parent: Rick Gigger <rick@alpinenetworking.com>
  1 sibling, 1 reply; 47+ messages in thread

From: Alvaro Herrera Munoz @ 2003-11-20 21:06 UTC (permalink / raw)
  To: Rick Gigger <rick@alpinenetworking.com>; +Cc: Mike Mascari <mascarm@mascari.com>; pgsql-general

On Thu, Nov 20, 2003 at 01:52:10PM -0700, Rick Gigger wrote:

> I worked around this by starting the transaction and inserting the 45,000
> rows and then killing it.  The I removed the index and readded it which
> apparently gathered some stats and since there were all of the dead tuples
> in there from the failed transaction it now decided that it should use the
> index.  I reran the script and this time it took 5 minutes again instead of
> 1 1/2 hours.

Stats are not collected automatically.  You should run ANALYZE after
importing your data.  And it's probably faster to create the index after
the data is loaded, too.

-- 
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
Y una voz del caos me habló y me dijo
"Sonríe y sé feliz, podría ser peor".
Y sonreí. Y fui feliz.
Y fue peor.



^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-20 21:07  Rick Gigger <rick@alpinenetworking.com>
  parent: fred@redhotpenguin.com
  0 siblings, 0 replies; 47+ messages in thread

From: Rick Gigger @ 2003-11-20 21:07 UTC (permalink / raw)
  To: fred@redhotpenguin.com; +Cc: Doug McNaught <doug@mcnaught.org>; scott.marlowe <scott.marlowe@ihs.com>; pgsql-general

Ah, so then the 25% recomendation for a starting point is probably not a bad
one, but if you get over a 1 gig of ram you might as well stop at about
256mb for the shared buffers because it just won't do you much good and will
start to slow down small queries.

That makes sense to me.

----- Original Message ----- 
From: <fred@redhotpenguin.com>
To: "Rick Gigger" <rick@alpinenetworking.com>
Cc: "Doug McNaught" <doug@mcnaught.org>; "scott.marlowe"
<scott.marlowe@ihs.com>; "PgSQL General ML" <pgsql-general@postgresql.org>
Sent: Thursday, November 20, 2003 1:59 PM
Subject: Re: [GENERAL] performance problem


> As discussed on previous posts and mentioned below, the kernel is often
> better at handling large amounts of buffers than Postgres.
>
> From researching previous posts and testing on my own setups, 256mb is
> about the max you want to go with shared buffers (if you have at least 1
> gig ram).  After that the smaller queries (which there are usually a lot
> of) slow down, and you only gain marginal improvement on the larger
> queries.  You'll see an improvement slightly on the large queries going
> over 256 but not enough to improve the overall performance.  There's a few
> more technically detailed explanations of this in the list archive I
> believe, by those who can explain it better than I.
>
> >> > > That's VERY high.  When postgresql has to manage a lot of buffers
it
> >> > > actually is slower than letting the kernel in Linux or BSD do it
for
> > you.
> >
> > I am confused.  In this tutorial (by Bruce Momjian)
> > http://candle.pha.pa.us/main/writings/pgsql/hw_performance/node8.html
> > it says: "As a start for tuning, use 25% of RAM for cache size, and 2-4%
> > for
> > sort size."
> >
> > If I've got 2g of RAM then that is 2097152k.  25% of that = 524288k.  So
> > the
> > tutorial is saying that 524288k is a good starting point for shared
> > buffers
> > with this amount of RAM.
> >
> > If each buffer is 8k
> > (http://candle.pha.pa.us/main/writings/pgsql/hw_performance/node3.html)
> > then that would be 65536 buffers.
> >
> > I'm pretty sure that that is a lot more than I need to cache every tuple
> > in
> > my database.  Now everytime I see someone comment on this list about
> > appropriate numbers for shared buffers they say something like "(65536
> > buffers is) VERY high.  Now since I obviously don't need that much
shared
> > cache so I am not concerned but it seems to me that one of the following
> > must be true.
> >
> > My calculations here are wrong.
> > or The tutorial is not accurate in saying that 25% is a good starting
> > point.
> > or The people making comments that 65536 is "VERY high" are wrong.
> >
> > Am I just confused or does this make sense?
> >
> >> > Even if you've got the memory to spare?  Does postgres actually slow
> > down
> >> > just because it's slower to manager a lot of them just or because
> >> you're
> >> > taking the memory away from the kernel so the kernel has to swap
more?
> >>
> >> The latter, mainly, I think.  Also you *really* don't want your kernel
> >> to swap out any of your shared buffers, which can happen if they take
> >> up a significant portion of RAM...
> >
> > So if I'm not swapping at all and I've got over 1g of unused memory then
> > I'm
> > probably ok even with the very high buffer setting? (Although I will
> > probably reduce it anyway since it is unnecessary).
> >
> > rg
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 7: don't forget to increase your free space map settings
> >
>
>




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-20 21:11  Andrew Sullivan <andrew@libertyrms.info>
  parent: Rick Gigger <rick@alpinenetworking.com>
  2 siblings, 0 replies; 47+ messages in thread

From: Andrew Sullivan @ 2003-11-20 21:11 UTC (permalink / raw)
  To: pgsql-general

On Thu, Nov 20, 2003 at 01:41:13PM -0700, Rick Gigger wrote:
> it says: "As a start for tuning, use 25% of RAM for cache size, and 2-4% for
> sort size."

It's an old rule of thumb which has been superseded by new tests.

A 

-- 
----
Andrew Sullivan                         204-4141 Yonge Street
Afilias Canada                        Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-20 21:12  Rick Gigger <rick@alpinenetworking.com>
  parent: Alvaro Herrera Munoz <alvherre@dcc.uchile.cl>
  0 siblings, 0 replies; 47+ messages in thread

From: Rick Gigger @ 2003-11-20 21:12 UTC (permalink / raw)
  To: Alvaro Herrera Munoz <alvherre@dcc.uchile.cl>; +Cc: Mike Mascari <mascarm@mascari.com>; pgsql-general

Ah, I didn't realize that you could just do an ANALYZE.  I thought there was
only VACUUM ANALYZE but that can't run inside of a transaction.

Thanks,

rg

----- Original Message ----- 
From: "Alvaro Herrera Munoz" <alvherre@dcc.uchile.cl>
To: "Rick Gigger" <rick@alpinenetworking.com>
Cc: "Mike Mascari" <mascarm@mascari.com>; "PgSQL General ML"
<pgsql-general@postgresql.org>
Sent: Thursday, November 20, 2003 2:06 PM
Subject: Re: [GENERAL] performance problem


On Thu, Nov 20, 2003 at 01:52:10PM -0700, Rick Gigger wrote:

> I worked around this by starting the transaction and inserting the 45,000
> rows and then killing it.  The I removed the index and readded it which
> apparently gathered some stats and since there were all of the dead tuples
> in there from the failed transaction it now decided that it should use the
> index.  I reran the script and this time it took 5 minutes again instead
of
> 1 1/2 hours.

Stats are not collected automatically.  You should run ANALYZE after
importing your data.  And it's probably faster to create the index after
the data is loaded, too.

-- 
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
Y una voz del caos me habló y me dijo
"Sonríe y sé feliz, podría ser peor".
Y sonreí. Y fui feliz.
Y fue peor.




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-20 21:13  Mike Mascari <mascarm@mascari.com>
  parent: Rick Gigger <rick@alpinenetworking.com>
  1 sibling, 1 reply; 47+ messages in thread

From: Mike Mascari @ 2003-11-20 21:13 UTC (permalink / raw)
  To: Rick Gigger <rick@alpinenetworking.com>; +Cc: pgsql-general

Rick Gigger wrote:

> Ok, adding the index back in worked the first time but then I tried
> generating the database from scratch again, this time adding the index right
> from the start.  It added the 45000 rows in about a minute but then was
> going dog slow on the updates again.  So I did an explain and sure enough it
> was not using the index.  After some investigation I determined that it was
> not using the index because when the transaction started there were only 4
> rows in the table so at that point it didn't want to use it.  It apparently
> doesn't gather analysis data fast enough to handle this kind of transaction.

The statistics are collected as a result of an ANALYZE command:

http://www.postgresql.org/docs/current/static/sql-analyze.html

This does not happen automatically. EXPLAIN output will show a default
assumption of 1000 rows, IIRC.

> I worked around this by starting the transaction and inserting the 45,000
> rows and then killing it.  The I removed the index and readded it which
> apparently gathered some stats and since there were all of the dead tuples
> in there from the failed transaction it now decided that it should use the
> index.  I reran the script and this time it took 5 minutes again instead of
> 1 1/2 hours.

If you examine the behavior of pg_dump output, you'll notice that it
doesn't built indexes until after the COPY command has completed the
data import. It's a waste of cpu cycles and disk bandwidth to update
indexes on upon every insert. Your script should:

1) Drop all indexes on the relation
2) Use COPY if possible instead of INSERT to import the data
3) Recreate the indexes
4) Use UPDATE to update as necessary

> I am using 7.2.4.  Has this improved in later versions?  I'm not concerened
> since this is a very rare thing to need to do and it's obviously possible to
> work around but it would be nice if postgres could figure things like that
> out on it's own.  (It certainly would have saved me a lot of time and
> confusion last night at about 3 am).  Is there a way to for the use of a
> specific index on a query?

You can force the use of an index scan by turning sequential scans to off:

SET ENABLE_SEQSCAN TO OFF;

But the problem is that the statistics didn't match the data. You
could have:

1) Used INSERTs to insert the data into a relation with an index
2) Executed ANALYZE <foo> to update the statistics
3) Perform the UPDATE

After the UPDATE, you'll still have dead tuples (the original rows)
which require that they be marked as dead, and so you should
occassionally run either VACUUM to mark them as such or VACUUM FULL to
reclaim the dead space or VACUUM FULL ANALYZE to also update the
relation's statistics.

I would just execute the steps I outlined above with COPY and not
worry about ANALYZEs and VACUUMs in a script. People often run VACUUM
ANALYZE in a 1/day cron job and VACUUM FULL ANALYZE in a 1/week cron
job. Then, of course, there's REINDEX...

Hope that helps,

Mike Mascari
mascarm@mascari.com





^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-20 21:19  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Rick Gigger <rick@alpinenetworking.com>
  2 siblings, 2 replies; 47+ messages in thread

From: Tom Lane @ 2003-11-20 21:19 UTC (permalink / raw)
  To: Rick Gigger <rick@alpinenetworking.com>; +Cc: Doug McNaught <doug@mcnaught.org>; scott.marlowe <scott.marlowe@ihs.com>; pgsql-general

"Rick Gigger" <rick@alpinenetworking.com> writes:
> I am confused.  In this tutorial (by Bruce Momjian)
> http://candle.pha.pa.us/main/writings/pgsql/hw_performance/node8.html
> it says: "As a start for tuning, use 25% of RAM for cache size, and 2-4% for
> sort size."

That advice is widely considered obsolete --- it was developed in the
days when typical RAM sizes were a lot less than today.  I don't believe
anyone has shown a good case for setting shared_buffers much higher than
10000.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-20 22:20  Rick Gigger <rick@alpinenetworking.com>
  parent: Mike Mascari <mascarm@mascari.com>
  0 siblings, 0 replies; 47+ messages in thread

From: Rick Gigger @ 2003-11-20 22:20 UTC (permalink / raw)
  To: Mike Mascari <mascarm@mascari.com>; +Cc: pgsql-general

> If you examine the behavior of pg_dump output, you'll notice that it
> doesn't built indexes until after the COPY command has completed the
> data import. It's a waste of cpu cycles and disk bandwidth to update
> indexes on upon every insert. Your script should:
>
> 1) Drop all indexes on the relation
> 2) Use COPY if possible instead of INSERT to import the data
> 3) Recreate the indexes
> 4) Use UPDATE to update as necessary

I never thought of dropping the indexes in the middle of the script and
readding them.  I guess that would be fine as long as nothing else was
running that needed the index while it was gone.  I don't think 7.2.x
supports using COPY unless you are inserting all of the fields which I don't
want to do although I suppose I could just insert all of the defaults.  Is
that correct?


> > I am using 7.2.4.  Has this improved in later versions?  I'm not
concerened
> > since this is a very rare thing to need to do and it's obviously
possible to
> > work around but it would be nice if postgres could figure things like
that
> > out on it's own.  (It certainly would have saved me a lot of time and
> > confusion last night at about 3 am).  Is there a way to for the use of a
> > specific index on a query?
>
> You can force the use of an index scan by turning sequential scans to off:
>
SET ENABLE_SEQSCAN TO OFF;

Thanks.


> But the problem is that the statistics didn't match the data. You
> could have:
>
> 1) Used INSERTs to insert the data into a relation with an index
> 2) Executed ANALYZE <foo> to update the statistics
> 3) Perform the UPDATE

That would have been the easiest thing.  I wanted to do that but I thought
that you had to do a vacuum (which I couldn't do in the transaction)
together with analyze.  I didn't realize that analyze was a command all by
itself.

> After the UPDATE, you'll still have dead tuples (the original rows)
> which require that they be marked as dead, and so you should
> occassionally run either VACUUM to mark them as such or VACUUM FULL to
> reclaim the dead space or VACUUM FULL ANALYZE to also update the
> relation's statistics.

I do them all nightly with cron on all my important databases.  I just had a
problem with need the analyze to happen in the middle of the transaction in
this one special case.

> I would just execute the steps I outlined above with COPY and not
> worry about ANALYZEs and VACUUMs in a script. People often run VACUUM
> ANALYZE in a 1/day cron job and VACUUM FULL ANALYZE in a 1/week cron
> job. Then, of course, there's REINDEX...

Doing the vacuum full analyze doesn't take long on to do if I do it once a
day so I just do that.




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-20 22:21  Rick Gigger <rick@alpinenetworking.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 47+ messages in thread

From: Rick Gigger @ 2003-11-20 22:21 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Doug McNaught <doug@mcnaught.org>; scott.marlowe <scott.marlowe@ihs.com>; pgsql-general

> "Rick Gigger" <rick@alpinenetworking.com> writes:
> > I am confused.  In this tutorial (by Bruce Momjian)
> > http://candle.pha.pa.us/main/writings/pgsql/hw_performance/node8.html
> > it says: "As a start for tuning, use 25% of RAM for cache size, and 2-4%
for
> > sort size."
>
> That advice is widely considered obsolete --- it was developed in the
> days when typical RAM sizes were a lot less than today.  I don't believe
> anyone has shown a good case for setting shared_buffers much higher than
> 10000.
>
> regards, tom lane

Thank you!




^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: performance problem
@ 2003-11-20 23:50  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 47+ messages in thread

From: Bruce Momjian @ 2003-11-20 23:50 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Rick Gigger <rick@alpinenetworking.com>; Doug McNaught <doug@mcnaught.org>; scott.marlowe <scott.marlowe@ihs.com>; pgsql-general

Tom Lane wrote:
> "Rick Gigger" <rick@alpinenetworking.com> writes:
> > I am confused.  In this tutorial (by Bruce Momjian)
> > http://candle.pha.pa.us/main/writings/pgsql/hw_performance/node8.html
> > it says: "As a start for tuning, use 25% of RAM for cache size, and 2-4% for
> > sort size."
> 
> That advice is widely considered obsolete --- it was developed in the
> days when typical RAM sizes were a lot less than today.  I don't believe
> anyone has shown a good case for setting shared_buffers much higher than
> 10000.

Yes, I will update that page shortly.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Performance problem
@ 2006-10-13 05:13  roopa perumalraja <roopabenzer@yahoo.com>
  0 siblings, 0 replies; 47+ messages in thread

From: roopa perumalraja @ 2006-10-13 05:13 UTC (permalink / raw)
  To: pgsql-general

I am new to postgres and I have 4 doubts.
   
  1) I have a performance problem as I am trying to insert around 60 million rows to a table which is partitioned. So first I copied the .csv file which contains data, with COPY command to a temp table which was quick. It took only 15 to 20 minutes. Now I am inserting data from temp table to original table using insert into org_table (select * from temp_table); which is taking more than an hour & is still inserting. Is there an easy way to do this?
   
  2) I want to increase the performance of database as I find it very slow which has more than 60 million rows in one table. I increased the shared_buffer parameter in postgres.conf file to 20000 but that does help much.
   
  3) I have partitioned a parent table into 100 child tables so when I insert data to parent table, it automatically inserts to child table. I have followed http://www.postgresql.org/docs/8.1/interactive/ddl-partitioning.html. When I did this, I noticed that when I viewed data of parent table, it had the rows of the child table and is not empty. But the child tables do have the rows in it. I don’t understand.
   
  4) I want to use materialized views, I don’t understand it from http://jonathangardner.net/PostgreSQL/materialized_views/matviews.html, can anyone explain me with a simple example.
   
  Thanks in advance.
   
  Regards
  Roopa 

 		
---------------------------------
Get your email and more, right on the  new Yahoo.com 

^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Performance Problem
@ 2006-10-13 05:26  roopa perumalraja <roopabenzer@yahoo.com>
  0 siblings, 2 replies; 47+ messages in thread

From: roopa perumalraja @ 2006-10-13 05:26 UTC (permalink / raw)
  To: pgsql-general

I am new to postgres and I have 4 doubts.
   
  1) I have a performance problem as I am trying to insert around 60 million rows to a table which is partitioned. So first I copied the .csv file which contains data, with COPY command to a temp table which was quick. It took only 15 to 20 minutes. Now I am inserting data from temp table to original table using insert into org_table (select * from temp_table); which is taking more than an hour & is still inserting. Is there an easy way to do this?
   
  2) I want to increase the performance of database as I find it very slow which has more than 60 million rows in one table. I increased the shared_buffer parameter in postgres.conf file to 20000 but that does help much.
   
  2) I have partitioned a parent table into 100 child tables so when I insert data to parent table, it automatically inserts to child table. I have followed http://www.postgresql.org/docs/8.1/interactive/ddl-partitioning.html. When I did this, I noticed that when I viewed data of parent table, it had the rows of the child table and is not empty. But the child tables do have the rows in it. I don’t understand.
   
  3) I want to use materialized views, I don’t understand it from http://jonathangardner.net/PostgreSQL/materialized_views/matviews.html, can anyone explain me with a simple example.
   
  Thanks in advance.
   
  Regards
  Roopa 

 		
---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.

^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: Performance Problem
@ 2006-10-13 08:22  Martijn van Oosterhout <kleptog@svana.org>
  parent: roopa perumalraja <roopabenzer@yahoo.com>
  1 sibling, 1 reply; 47+ messages in thread

From: Martijn van Oosterhout @ 2006-10-13 08:22 UTC (permalink / raw)
  To: roopa perumalraja <roopabenzer@yahoo.com>; +Cc: pgsql-general

On Thu, Oct 12, 2006 at 10:26:28PM -0700, roopa perumalraja wrote:
> I am new to postgres and I have 4 doubts.
>    
>   1) I have a performance problem as I am trying to insert around 60
>   million rows to a table which is partitioned. So first I copied the
>   .csv file which contains data, with COPY command to a temp table
>   which was quick. It took only 15 to 20 minutes. Now I am inserting
>   data from temp table to original table using insert into org_table
>   (select * from temp_table); which is taking more than an hour & is
>   still inserting. Is there an easy way to do this?

Does the table you're inserting into have indexes or foreign keys?
Either of those slow down loading considerably. One commen workaround
is to drop the indexes and constraints, load the data and re-add them.

>   2) I want to increase the performance of database as I find it very
>   slow which has more than 60 million rows in one table. I increased
>   the shared_buffer parameter in postgres.conf file to 20000 but that
>   does help much.

Find out the queries that are slow and use EXPLAIN to identify possible
useful indexes.

>   2) I have partitioned a parent table into 100 child tables so when
>   I insert data to parent table, it automatically inserts to child
>   table. I have followed
>   http://www.postgresql.org/docs/8.1/interactive/ddl-partitioning.html.
>   When I did this, I noticed that when I viewed data of parent table,
>   it had the rows of the child table and is not empty. But the child
>   tables do have the rows in it. I don’t understand.

When you select from a parent table, it shows the rows of the child
tables also, that's kind of the point. You can say: SELECT * FROM ONLY
parent;

The partitioning may only explain the slow loading...

>   3) I want to use materialized views, I don’t understand it from
>   http://jonathangardner.net/PostgreSQL/materialized_views/matviews.html,
>   can anyone explain me with a simple example.

Can't help you there...

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachments:

  signature.asc (application/pgp-signature, 188B) download

^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: Performance Problem
@ 2006-10-13 08:55  Uwe C. Schroeder <uwe@oss4u.com>
  parent: Martijn van Oosterhout <kleptog@svana.org>
  0 siblings, 1 reply; 47+ messages in thread

From: Uwe C. Schroeder @ 2006-10-13 08:55 UTC (permalink / raw)
  To: pgsql-general; Martijn van Oosterhout <kleptog@svana.org>; +Cc: roopa perumalraja <roopabenzer@yahoo.com>

On Friday 13 October 2006 01:22, Martijn van Oosterhout wrote:
> >   1) I have a performance problem as I am trying to insert around 60
> >   million rows to a table which is partitioned. So first I copied the
> >   .csv file which contains data, with COPY command to a temp table
> >   which was quick. It took only 15 to 20 minutes. Now I am inserting
> >   data from temp table to original table using insert into org_table
> >   (select * from temp_table); which is taking more than an hour & is
> >   still inserting. Is there an easy way to do this?
>
> Does the table you're inserting into have indexes or foreign keys?
> Either of those slow down loading considerably. One commen workaround
> is to drop the indexes and constraints, load the data and re-add them.

Why do you COPY the data into a temporary table just to do a "insert into 
org_table  (select * from temp_table);" ? Since you're copying ALL records 
anyways, why don't you just copy the data into the "org_table" directly?

Also look for the "autocommit" setting. If autocommit is on, every insert is a 
transaction on it's own - leading to a lot of overhead. Turning autocommit 
off and running the inserts in batches of - say 1000 inserts per transaction 
- will increase speed considerably.


	UC

--
Open Source Solutions 4U, LLC	1618 Kelly St
Phone:  +1 707 568 3056		Santa Rosa, CA 95401
Cell:   +1 650 302 2405		United States
Fax:    +1 707 568 6416



^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: Performance Problem
@ 2006-10-13 09:00  A. Kretschmer <andreas.kretschmer@schollglas.com>
  parent: Uwe C. Schroeder <uwe@oss4u.com>
  0 siblings, 0 replies; 47+ messages in thread

From: A. Kretschmer @ 2006-10-13 09:00 UTC (permalink / raw)
  To: pgsql-general

am  Fri, dem 13.10.2006, um  1:55:06 -0700 mailte Uwe C. Schroeder folgendes:
> > Does the table you're inserting into have indexes or foreign keys?
> > Either of those slow down loading considerably. One commen workaround
> > is to drop the indexes and constraints, load the data and re-add them.
> 
> Why do you COPY the data into a temporary table just to do a "insert into 
> org_table  (select * from temp_table);" ? Since you're copying ALL records 
> anyways, why don't you just copy the data into the "org_table" directly?

Perhaps he want to modify the data in this temp. table?


> 
> Also look for the "autocommit" setting. If autocommit is on, every insert is a 
> transaction on it's own - leading to a lot of overhead. Turning autocommit 
> off and running the inserts in batches of - say 1000 inserts per transaction 
> - will increase speed considerably.

A 'insert into org_table  (select * from temp_table);' is only ONE
transaction.


Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47215,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net



^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: Performance Problem
@ 2006-10-13 12:09  Richard Broersma Jr <rabroersma@yahoo.com>
  parent: roopa perumalraja <roopabenzer@yahoo.com>
  1 sibling, 0 replies; 47+ messages in thread

From: Richard Broersma Jr @ 2006-10-13 12:09 UTC (permalink / raw)
  To: roopa perumalraja <roopabenzer@yahoo.com>; pgsql-general

>   3) I want to use materialized views, I don?t understand it from
> http://jonathangardner.net/PostgreSQL/materialized_views/matviews.html, can anyone explain me
> with a simple example.

The following link helps to describe the idea behind each of the methods of Materialize views.

http://jarednevans.typepad.com/technoblog/2006/03/materialized_vi.html

Regards,

Richard Broersma Jr.



^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Performance Problem
@ 2020-03-03 08:36  Kordexa Stroken <diziburda1@gmail.com>
  0 siblings, 2 replies; 47+ messages in thread

From: Kordexa Stroken @ 2020-03-03 08:36 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

 Hello iam working on a project and using Postgresql 10.My main server 2 x
E5 2680 v3 Cpu NVMe M.2 500 Gb Disk 32 GB Ram and my postgresql server is a
VM(VirtualBox) Centos7 16GB ram Postgresql 10 Db size 4 GB and my solution
is N-Tier Architecture & 40 online user . My postgresql.conf here:

    https://pastebin.com/Y8ybSxq4

I have performance problem with postgresql.What is wrong ? I can not find
what is problem.

^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: Performance Problem
@ 2020-03-05 01:28  David G. Johnston <david.g.johnston@gmail.com>
  parent: Kordexa Stroken <diziburda1@gmail.com>
  1 sibling, 0 replies; 47+ messages in thread

From: David G. Johnston @ 2020-03-05 01:28 UTC (permalink / raw)
  To: Kordexa Stroken <diziburda1@gmail.com>; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>

On Wed, Mar 4, 2020 at 6:17 PM Kordexa Stroken <diziburda1@gmail.com> wrote:

>  Hello iam working on a project and using Postgresql 10.My main server 2 x
> E5 2680 v3 Cpu NVMe M.2 500 Gb Disk 32 GB Ram and my postgresql server is a
> VM(VirtualBox) Centos7 16GB ram Postgresql 10 Db size 4 GB and my solution
> is N-Tier Architecture & 40 online user . My postgresql.conf here:
>
>     https://pastebin.com/Y8ybSxq4
>
> I have performance problem with postgresql.What is wrong ? I can not find
> what is problem.
>

Not really sure how anyone else would be able to either.

Here are some suggestions for how to request help that is actionable:

https://wiki.postgresql.org/wiki/Slow_Query_Questions

Start specific and then generalize.

David J.

^ permalink  raw  reply  [nested|flat] 47+ messages in thread

* Re: Performance Problem
@ 2020-03-05 01:37  Justin <zzzzz.graf@gmail.com>
  parent: Kordexa Stroken <diziburda1@gmail.com>
  1 sibling, 0 replies; 47+ messages in thread

From: Justin @ 2020-03-05 01:37 UTC (permalink / raw)
  To: Kordexa Stroken <diziburda1@gmail.com>; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>

taking a quick glance at config file I do not see any modifications to any
key settings

shared_buffers,
efffecttive cache size
work_mem

meaning the server is running at the default settings which results in
horrible performance

here is a website that gives suggested config changes based on server
hardware.  https://pgtune.leopard.in.ua/#/

That said to get help on slow queries  need to describe the  tables in
question, post the query in question along with explain/analyze results

On Wed, Mar 4, 2020 at 8:17 PM Kordexa Stroken <diziburda1@gmail.com> wrote:

>  Hello iam working on a project and using Postgresql 10.My main server 2 x
> E5 2680 v3 Cpu NVMe M.2 500 Gb Disk 32 GB Ram and my postgresql server is a
> VM(VirtualBox) Centos7 16GB ram Postgresql 10 Db size 4 GB and my solution
> is N-Tier Architecture & 40 online user . My postgresql.conf here:
>
>     https://pastebin.com/Y8ybSxq4
>
> I have performance problem with postgresql.What is wrong ? I can not find
> what is problem.
>

^ permalink  raw  reply  [nested|flat] 47+ messages in thread


end of thread, other threads:[~2020-03-05 01:37 UTC | newest]

Thread overview: 47+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-01-24 13:57 Performance problem Andreas Rieke <andreas.rieke@isl-online.de>
2001-01-24 19:34 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2001-03-30 17:10 Performance-Problem Konstantinos Agouros <elwood@agouros.de>
2003-03-12 14:27 Performance Problem Stefan Sturm <mailling@anrath.info>
2003-03-12 14:57 ` Re: Performance Problem Stephan Szabo <sszabo@megazone23.bigpanda.com>
2003-03-12 16:31 ` Re: Performance Problem Steve Crawford <scrawford@pinpointresearch.com>
2003-03-12 17:28 ` Re: Performance Problem scott.marlowe <scott.marlowe@ihs.com>
2003-03-12 23:21   ` Re: Performance Problem Stephen Robert Norris <srn@commsecure.com.au>
2003-04-16 01:40 Performance Problem Pedro C. Arias <parias@unr.edu.ar>
2003-04-16 01:51 ` Re: Performance Problem Stephan Szabo <sszabo@megazone23.bigpanda.com>
2003-04-16 06:59 ` Re: Performance Problem Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
2003-05-12 13:57 Performance Problem Adam Sherman <adam@tritus.ca>
2003-05-12 15:42 ` Re: Performance Problem Bruno Wolff III <bruno@wolff.to>
2003-05-12 17:01   ` Re: Performance Problem Adam Sherman <adam@tritus.ca>
2003-05-12 23:18     ` Re: Performance Problem Joseph Shraibman <jks@selectacast.net>
2003-05-12 23:41       ` Re: Performance Problem Adam Sherman <adam@tritus.ca>
2003-05-13 00:18         ` Re: Performance Problem Joseph Shraibman <jks@selectacast.net>
2003-11-18 20:43 performance problem Rick Gigger <rick@alpinenetworking.com>
2003-11-18 21:03 ` Re: performance problem Mike Mascari <mascarm@mascari.com>
2003-11-18 21:41   ` Re: performance problem Rick Gigger <rick@alpinenetworking.com>
2003-11-20 20:52     ` Re: performance problem Rick Gigger <rick@alpinenetworking.com>
2003-11-20 21:06       ` Re: performance problem Alvaro Herrera Munoz <alvherre@dcc.uchile.cl>
2003-11-20 21:12         ` Re: performance problem Rick Gigger <rick@alpinenetworking.com>
2003-11-20 21:13       ` Re: performance problem Mike Mascari <mascarm@mascari.com>
2003-11-20 22:20         ` Re: performance problem Rick Gigger <rick@alpinenetworking.com>
2003-11-18 21:24 ` Re: performance problem scott.marlowe <scott.marlowe@ihs.com>
2003-11-18 23:54   ` Re: performance problem Rick Gigger <rick@alpinenetworking.com>
2003-11-19 02:25     ` Re: performance problem Doug McNaught <doug@mcnaught.org>
2003-11-20 20:41       ` Re: performance problem Rick Gigger <rick@alpinenetworking.com>
2003-11-20 20:59         ` Re: performance problem fred@redhotpenguin.com
2003-11-20 21:07           ` Re: performance problem Rick Gigger <rick@alpinenetworking.com>
2003-11-20 21:11         ` Re: performance problem Andrew Sullivan <andrew@libertyrms.info>
2003-11-20 21:19         ` Re: performance problem Tom Lane <tgl@sss.pgh.pa.us>
2003-11-20 22:21           ` Re: performance problem Rick Gigger <rick@alpinenetworking.com>
2003-11-20 23:50           ` Re: performance problem Bruce Momjian <pgman@candle.pha.pa.us>
2003-11-19 02:30     ` Re: performance problem Martijn van Oosterhout <kleptog@svana.org>
2003-11-18 21:50 ` Re: performance problem Martin Marques <martin@bugs.unl.edu.ar>
2003-11-18 21:11 Re: performance problem Dann Corbit <DCorbit@connx.com>
2006-10-13 05:13 Performance problem roopa perumalraja <roopabenzer@yahoo.com>
2006-10-13 05:26 Performance Problem roopa perumalraja <roopabenzer@yahoo.com>
2006-10-13 08:22 ` Re: Performance Problem Martijn van Oosterhout <kleptog@svana.org>
2006-10-13 08:55   ` Re: Performance Problem Uwe C. Schroeder <uwe@oss4u.com>
2006-10-13 09:00     ` Re: Performance Problem A. Kretschmer <andreas.kretschmer@schollglas.com>
2006-10-13 12:09 ` Re: Performance Problem Richard Broersma Jr <rabroersma@yahoo.com>
2020-03-03 08:36 Performance Problem Kordexa Stroken <diziburda1@gmail.com>
2020-03-05 01:28 ` Re: Performance Problem David G. Johnston <david.g.johnston@gmail.com>
2020-03-05 01:37 ` Re: Performance Problem Justin <zzzzz.graf@gmail.com>

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