Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: Abnormal performance difference between Postgres and MySQL


  • From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
  • To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
  • Cc: Farhan Husain <russoue(at)gmail(dot)com>, Gregory Stark <stark(at)enterprisedb(dot)com>, pgsql-performance(at)postgresql(dot)org
  • Subject: Re: Abnormal performance difference between Postgres and MySQL
  • Date: Mon, 23 Feb 2009 21:00:58 -0500
  • Message-id: <138.1235440858@sss.pgh.pa.us> <text/plain>

Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> writes:
> On Mon, Feb 23, 2009 at 6:24 PM, Farhan Husain <russoue(at)gmail(dot)com> wrote:
> This sort here:

>> ->  Sort  (cost=565372.46..568084.16 rows=1084680 width=74) (actual
>> time=5410606.604..5410606.628 rows=31 loops=1)
>>       Sort Key: a1.subj
>>       Sort Method:  quicksort  Memory: 489474kB
>>       ->  Seq Scan on jena_g1t1_stmt a1  (cost=0.00..456639.59
>>       rows=1084680 width=74) (actual time=0.043..44005.780 rows=3192000 loops=1)

> Seems to be the problem.  There are a few things that seem odd, the
> first is that it estimates it will return 1M ros, but returns only 31.
>  The other is that sorting 31 rows is taking 5410606 milliseconds.

Uh, no, it's sorting 3192000 rows --- look at the input scan.  Evidently
only the first 31 of those rows are getting fetched out of the sort,
though.

			regards, tom lane



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group