Re: [HACKERS] \dt and disk access - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] \dt and disk access
Date
Msg-id 4ad3422050a4cbfc7e2aa8b90ecf6a3d
Whole thread Raw
In response to [HACKERS] \dt and disk access  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
>
> Can someone suggest why running the \dt comand in psql causes so many
> disk accesses?
>
> I am seeing some queries causing a lot of disk access that doesn't make
> sense to me.
>
> I am running my server with fsync off.

I now realize the unusual disk activity is caused by any query that uses
an ORDER BY.  A query that returns three rows takes MUCH longer with the
ORDER BY than without it, 0.20 seconds vs. 0.61 seconds, three times
longer.

The query is:

    select * from matter

AND

    select * from matter order by matter

The table has three short text columns.


Would anyone like to comment on why ORDER BY is doing this?  It
certainly slows down the query.  I am running BSD/OS.

This is of course using PostgreSQL 6.1.

- --
Bruce Momjian
maillist@candle.pha.pa.us

------------------------------

pgsql-hackers by date:

Previous
From: "Thomas G. Lockhart"
Date:
Subject: Re: [HACKERS] Problem with copying abstimes
Next
From: Igor
Date:
Subject: Re: [HACKERS] \dt and disk access