On MySQL:
   4543 rows in set (0.28 sec)
  41573 rows in set (1.69 sec)

So if this fixes it for Pg, then I think we've got a winner :-)

Aaron


On Mon, Mar 14, 2005, Geo Carncross <[EMAIL PROTECTED]>
said:

> Thomas:
> 
> I just got done loading a shitload of messages. I'm seeing _exactly_ the
> query plan I suspected, and I'm using the create_tables.sql from
> branch_2.0 -- after adding indexes found in the create_tables.sql in
> trunk, I noticed an insignificant speed change.
> 
> I've got 6000 messages here, and subsecond queries; here's the EXACT
> query:
> 
> SELECT
>  a.seen_flag,
>  a.answered_flag,
>  a.deleted_flag,
>  a.flagged_flag,
>  a.draft_flag,
>  a.recent_flag,
>  TO_CHAR(b.internal_date, 'YYYY-MM-DD HH24:MI:SS'),
>  b.rfcsize,
>  a.message_idnr
> 
> FROM dbmail_physmessage AS b JOIN dbmail_messages AS a
> ON a.physmessage_id=b.id
> WHERE message_idnr BETWEEN '1' AND '417966'
>  AND mailbox_idnr = '1'
>  AND status < '2';

--

Reply via email to