Re: Query performance PLEASE HELP

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dmitry Tkach <dmitry(at)openratings(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Query performance PLEASE HELP
Date: 2003-01-31 19:00:15
Message-ID: 20976.1044039615@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dmitry Tkach <dmitry(at)openratings(dot)com> writes:
> Well... Yes. I am doing that daily. Actually, I was wonderring about
> those estimates too, but that's not my primary concern right now -
> perhaps, it should be, but, as far as I understand, the estimate only
> matter for the query plan selection, and I don't have a problem with the
> query plan

You should. If the query can be done any faster, it will be by picking
a different query plan. I'm not sure what would be a better plan, but
certainly a large part of the problem is that the planner is so far off
about the rowcount estimates.

One thing I'm wondering is if the index on tradestyle.name could be helpful.
How selective is "ts.name like 'POST%'", exactly --- does that eliminate
a lot of rows, or not? Is the thing able to use that as an indexqual
(ie, are you in C locale)?

To tell you the truth, I do not believe your assertion that these tables
have been analyzed. I don't see how the rowcount estimates could be so
small if the planner were aware of the true table statistics. What does
pg_stats show for the columns used in the query?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-01-31 19:06:23 Re: limited field duplicates
Previous Message Arjen van der Meijden 2003-01-31 18:55:15 Re: very basic question