Re: 7.3.1 New install, large queries are slow

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Roman Fail <rfail(at)posportal(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: 7.3.1 New install, large queries are slow
Date: 2003-01-15 20:42:59
Message-ID: 1042663379.1951.1.camel@rh72.home.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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(at)tm(dot)ee>

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Roman Fail 2003-01-15 23:30:55 Re: 7.3.1 New install, large queries are slow
Previous Message Andrew Sullivan 2003-01-15 20:10:12 Re: 7.3.1 New install, large queries are slow