Re: PostgreSQL runs a query much slower than BDE and MySQL

Поиск
Список
Период
Сортировка
Искать
От
Peter Hardman
Тема
Re: PostgreSQL runs a query much slower than BDE and MySQL
Дата
Msg-id
44E4DBE7.22131.10181D0@peter.ssbg.zetnet.co.uk
Ответ на
Список
Дерево обсуждения
PostgreSQL runs a query much slower than BDE and MySQL "Peter Hardman" <peter@ssbg.zetnet.co.uk>
Re: PostgreSQL runs a query much slower than BDE and MySQL Tom Lane <tgl@sss.pgh.pa.us>
Re: PostgreSQL runs a query much slower than BDE and MySQL "Peter Hardman" <peter@ssbg.zetnet.co.uk>
Re: PostgreSQL runs a query much slower than BDE and MySQL Markus Schaber <schabi@logix-tt.com>
Re: PostgreSQL runs a query much slower than BDE and MySQL "Peter Hardman" <peter@ssbg.zetnet.co.uk>
Re: PostgreSQL runs a query much slower than BDE and MySQL Markus Schaber <schabi@logix-tt.com>
Re: PostgreSQL runs a query much slower than BDE and MySQL Tom Lane <tgl@sss.pgh.pa.us>
Re: PostgreSQL runs a query much slower than BDE and Mark Lewis <mark.lewis@mir3.com>
Re: PostgreSQL runs a query much slower than BDE and "Magnus Hagander" <mha@sollentuna.net>
Re: PostgreSQL runs a query much slower than BDE and MySQL Tom Lane <tgl@sss.pgh.pa.us>
Re: PostgreSQL runs a query much slower than BDE and Simon Riggs <simon@2ndquadrant.com>
Re: PostgreSQL runs a query much slower than BDE and MySQL "Peter Hardman" <peter@ssbg.zetnet.co.uk>
Re: PostgreSQL runs a query much slower than BDE and MySQL Tom Lane <tgl@sss.pgh.pa.us>
Re: PostgreSQL runs a query much slower than BDE and MySQL Scott Lamb <slamb@slamb.org>
Re: PostgreSQL runs a query much slower than BDE and MySQL Scott Lamb <slamb@slamb.org>
Re: PostgreSQL runs a query much slower than BDE and MySQL Scott Lamb <slamb@slamb.org>
Re: PostgreSQL runs a query much slower than BDE and MySQL Arjen van der Meijden <acmmailing@tweakers.net>
Re: PostgreSQL runs a query much slower than BDE and MySQL "Peter Hardman" <peter@ssbg.zetnet.co.uk>
Re: PostgreSQL runs a query much slower than BDE and MySQL "Peter Hardman" <peter@ssbg.zetnet.co.uk>
Re: PostgreSQL runs a query much slower than BDE and MySQL "Peter Hardman" <peter@ssbg.zetnet.co.uk>
Re: PostgreSQL runs a query much slower than BDE and MySQL "Rodrigo De León" <rdeleonp@gmail.com>
On 17 Aug 2006 at 14:33, Tom Lane wrote:

> I wrote:
> > Anywy, your point about the sort being redundant is a good one, and
> > offhand I'd have expected PG to catch that; I'll have to look into
> > why it didn't.  But that's not going to explain a 10x speed
> > difference, because the sort isn't 90% of the runtime.
> 
> I dug into this using some made-up test data, and was able to reproduce
> the plan you got after changing the order of the pkey index columns
> to (regn_no, transfer_date, flock_no) ... are you sure you quoted that
> accurately before?

Yes. Maybe the data I've uploaded to www.shetland-
sheep.org.uk/pgdata/sheep_flock.zip will help reproduce the plan.

 
> I found a couple of minor planner problems, which I've repaired in CVS
> HEAD.  You might consider using TEXT columns instead of VARCHAR(n),
> because the only bug that actually seemed to change the chosen plan
> involved the planner getting confused by the difference between
> varchar_var and varchar_var::text (which is what gets generated for
> sorting purposes because varchar doesn't have a separate sort operator).

As someone else suggested, these fields ought really to be CHAR no VARCHAR. 
I chose VARCHAR because the data mostly is shorter than the maximum lengths 
(although probably not enough to matter). I'd not really got into the subtleties of 
different behaviour of CHAR and VARCHAR.
> 
 

Regards,-- 
Peter Hardman
Acre Cottage, Horsebridge
King's Somborne
Stockbridge
SO20 6PT

== Breeder of Shetland Cattle and Shetland Sheep ==

В списке pgsql-performance по дате отправления
От: Peter Hardman
Дата:
От: Peter Hardman
Дата:
FAQ