voodoo planner update - Mailing list pgsql-novice

From D. Duccini
Subject voodoo planner update
Date
Msg-id Pine.GSO.4.03.10205072020180.20094-100000@ra.bpsi.net
Whole thread Raw
In response to more voodoo planner bs :)  ("D. Duccini" <duccini@backpack.com>)
List pgsql-novice
Here's where things get interesting:

now things have flipped around!

billdate = 1 is SLOWER than billdate = any other value

# explain select s.id from subaccounts s, accounts a where a.id = s.idaccount and a.billdate = 2;
NOTICE:  QUERY PLAN:

Nested Loop  (cost=0.00..16.42 rows=2 width=12)
  ->  Index Scan using idxaccountbilldate on accounts a  (cost=0.00..2.02 rows=1 width=4)
  ->  Index Scan using idxsubprimary on subaccounts s  (cost=0.00..14.22 rows=15 width=8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# explain select s.id from subaccounts s, accounts a where a.id = s.idaccount and a.billdate = 1;
NOTICE:  QUERY PLAN:

Hash Join  (cost=79.83..310.33 rows=3506 width=12)
  ->  Seq Scan on subaccounts s  (cost=0.00..71.10 rows=3510 width=8)
  ->  Hash  (cost=76.03..76.03 rows=1520 width=4)
        ->  Seq Scan on accounts a  (cost=0.00..76.03 rows=1520 width=4)





-----------------------------------------------------------------------------
david@backpack.com            BackPack Software, Inc.        www.backpack.com
+1 651.645.7550 voice       "Life is an Adventure.
+1 651.645.9798 fax            Don't forget your BackPack!"
-----------------------------------------------------------------------------


pgsql-novice by date:

Previous
From: "D. Duccini"
Date:
Subject: more voodoo planner bs :)
Next
From: "Brian Schroeder"
Date:
Subject: Relation does not exist