On Sat, 2004-06-26 at 04:16, Együd Csaba wrote:
> Hi All,
> I've a problem with the perfprmance of the production environment.
> I've two db servers. One on my laptop computer (2Ghz, 1GB, WinXP, Cygwin,
> Postgres 7.3.4) and one on a production server (2GHz, 1GB, Ultra SCSI,
> RH7.1, Postgres 7.3.2).
>
> I run the same dump and the same query on both of the computers. The
> difference is substantial.
> The query takes 5 times longer on the production server then on the laptop.
>
> What can be the reason? Could anybody suggest me something?
> Thakn you in advance.
>
> QUERY PLAN on my laptop:
> ------------------------
> Sort (cost=70.17..72.38 rows=885 width=184) (actual time=7264.00..7264.00
> rows=885 loops=1)
> Sort Key: artnum
> -> Seq Scan on t_products (cost=0.00..26.85 rows=885 width=184) (actual
> time=21.00..7259.00 rows=885 loops=1)
> QUERY PLAN on the production server:
> ------------------------------------
> Sort (cost=70.17..72.38 rows=885 width=121) (actual time=36729.92..36730.18
> rows=885 loops=1)
> Sort Key: artnum
> -> Seq Scan on t_products (cost=0.00..26.85 rows=885 width=121) (actual
> time=45.16..36724.73 rows=885 loops=1)
This is the only real difference between the two, the time it's taking
to seq scan that table. Have you done a vacuum full on it lately? If
the table is the same size on the disk, but is taking 5 times longer on
the production server, then something on that machine is broken.