Re: Why is explain horribly optimistic for sorts?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ben <bench(at)silentmedia(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Why is explain horribly optimistic for sorts?
Date: 2001-03-03 18:18:43
Message-ID: 7019.983643523@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ben <bench(at)silentmedia(dot)com> writes:
> Yes, it is horribly wrong.
> select count(*) FROM jennyann where target like '/music/%'
> gives me 93686 rows.

Well, that misestimation is the source of the problem, then, not any
misestimation of the cost of a sort.

7.0 didn't have very good estimation rules for LIKE clauses, at least
not by default. Have you tried the new LIKE estimator (see
contrib/likeplanning/README in the source tree)? I'm not sure it will
do any better, given that your data appears to be mightily nonuniform
;-), but it's worth a try.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ben 2001-03-03 18:19:27 Re: Why is explain horribly optimistic for sorts?
Previous Message Ben 2001-03-03 18:09:44 Re: Why is explain horribly optimistic for sorts?