pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hannu Krosing <hannu@tm.ee>
To: Roman Fail <rfail@posportal.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: 7.3.1 New install, large queries are slow
Date: 16 Jan 2003 01:42:59 +0500
Message-ID: <1042663379.1951.1.camel@rh72.home.ee> (raw)
In-Reply-To: <9B1C77393DED0D4B9DAA1AA1742942DA0E4BF9@pos_pdc.posportal.com>
References: <9B1C77393DED0D4B9DAA1AA1742942DA0E4BF9@pos_pdc.posportal.com>

Roman Fail kirjutas K, 15.01.2003 kell 23:00:
> I am trying to get a PostgreSQL server into production (moving from MSSQL2K) but having some serious performance issues.  PostgreSQL is new to me, and I'm only just now comfortable with Linux.  So far I've succesfully compiled postgres from source and migrated all the data from MSSQL.  Postgres is primarily accessed using JDBC.  
>  
> I really want to use Postgres for production, but if I can't get better results out of it by the end of the week we are dropping it forever and going back to MSSQL despite the $$$.  I'm basically at a point where I've got to find help from the list.  Please help me make this server fly!
>  
> I have a query that does many joins (including two very big tables) which is slow on Postgres.  On PGSQL the query takes 19 minutes, but only 3 seconds on MSSQL.  The two servers have the same indexes created (including primary key indexes).  I finally gave up on creating all the foreign keys in Postgres - after 12 hours of 100% CPU.  It's hard for me to believe that the hardware is the bottleneck - the $20k Postgres server far outclasses the MSSQL server (see below for stats).  When I ran EXPLAIN ANALYZE for this query the CPU averaged 5%, sar -b shows about 6,000 block reads/sec, and vmstat had zero swapping.  EXPLAIN results are below, I'm not sure how to interpret them.
>  

Two questions:

1) Have you run analyze on this database (after loading the data ?)

2) could you also post the actual query - it would make interpreting the
EXPLAIN ANALYZE RESULTS easier.

-- 
Hannu Krosing <hannu@tm.ee>



view thread (66+ messages)  latest in thread

Message-ID: <1042663379.1951.1.camel@rh72.home.ee>
Permalink:  ../1042663379.1951.1.camel@rh72.home.ee/
Also on:    postgresql.org/message-id/1042663379.1951.1.camel@rh72.home.ee

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: hannu@tm.ee, rfail@posportal.com
  Subject: Re: 7.3.1 New install, large queries are slow
  In-Reply-To: <1042663379.1951.1.camel@rh72.home.ee>
  References: <9B1C77393DED0D4B9DAA1AA1742942DA0E4BF9@pos_pdc.posportal.com> <1042663379.1951.1.camel@rh72.home.ee>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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