Search Postgresql Archives

Re: Compound keys and foreign constraints

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 02, 2004 at 11:08:21AM -0600, wespvp@syntegra.com wrote:

> db=> explain analyze select count(*) from messages m, message_recipients r,
> addresses a WHERE r.Message_Key=m.Message_Key AND
> a.Address='joe.user@testdomain.com' AND a.Address_Key=r.Recipient AND (
> (m.Message_Date >= '29-MAR-04') AND (m.Message_Date <=
> TO_TIMESTAMP('31-MAR-04 23:59:59', 'dd-mon-yy HH24:MI:SS')::timestamp
> without time zone));
>                    
> QUERY PLAN         
> ----------------------------------------------------------------------------
> ----------------------------------------------------------------------------
> ------------------------------------------------------------------
[...]

>                ->  Index Scan using message_recipients_i_recipient on
> message_recipients r  (cost=0.00..30569.25 rows=30622 width=21) (actual
> time=83.146..31609.149 rows=312741 loops=1)

This estimate is off by an order of magnitude.  Maybe you want to
increase the statistic target for this column ...

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"The Postgresql hackers have what I call a "NASA space shot" mentality.
Quite refreshing in a world of "weekend drag racer" developers."
(Scott Marlowe)

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux