Re: Query optimization using order by and limit
| От | Tom Lane |
|---|---|
| Тема | Re: Query optimization using order by and limit |
| Дата | |
| Msg-id | 6768.1316657361@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Query optimization using order by and limit (Greg Smith <greg@2ndQuadrant.com>) |
| Ответы |
Re: Query optimization using order by and limit
|
| Список | pgsql-performance |
Greg Smith <greg@2ndQuadrant.com> writes:
> That weird casting can't be helping. I'm not sure if it's your problem
> here, but the constraint exclusion code is pretty picky about matching
> the thing you're looking for against the CHECK constraint, and this is a
> messy one. The bigint conversion in the middle there isn't doing
> anything useful for you anyway; you really should simplify this to just
> look like this:
> firstloadtime >= 129604464000000000::numeric
I have a more aggressive suggestion: change all the numeric(20,0) fields
to bigint. Unless the OP actually needs values wider than 64 bits,
the choice to use numeric is a significant performance penalty for
nothing.
regards, tom lane
В списке pgsql-performance по дате отправления: