Subject Same Query - Dirrerent GDBs - Different Plan
Author rodbracher
Hi

I run the same query on two different GDBs with EXACTLY the same
metadata. The user data is different. I run a query and on one GDB is
instant to execute - the other it takes about 30 seconds ( same local
server - my pc ). I noticed a different plan was being used.

GDB 1 Fast query execution

PLAN SORT (JOIN (JOIN (JOIN (ROUTING INDEX (RO_MANIFEST),WAYBILL
INDEX (RDB$PRIMARY67)),PLACE INDEX (RDB$PRIMARY50)),CONTENTS INDEX
(RDB$PRIMARY17)))

GDB 2 Slow query execution

PLAN SORT (JOIN (JOIN (JOIN (WAYBILL NATURAL,ROUTING INDEX
(RDB$PRIMARY58,RO_MANIFEST)),PLACE INDEX (RDB$PRIMARY50)),CONTENTS
INDEX (RDB$PRIMARY17)))

If I then put the Plan of GDB 1 in the query of GDB 2 it then
executes instantly ????

So my question is - can GDB size effect the plan ? ( GDB 2 780mb GDB
1 180mb - the relations on the query will have a similar size ratio )

Thanks

Rod