Subject different plan choose in superverver or classic
Author svanderclock
hello,

i do some try :
i juste restore one database on 2 different system :
1: windows vista 32 bit, Firebird SuperServer
2: windows server 2008 64 bit, Firebird Classic

so the database is exactly the same on the 2 computer

when i do query like :

select
ID_reader,
Write_access,
Full_access,
1 as inherited
from
PROPERTY_PUBLICATION
join TRANSAC on TRANSAC.ID=PROPERTY_PUBLICATION.ID_PROPERTY
join RESERVED_PERIOD on RESERVED_PERIOD.ID_transac=TRANSAC.ID
where
RESERVED_PERIOD.ID_tenant='XHRD' and
PROPERTY_PUBLICATION.Full_access=1

it's took 0 second on Firebird SuperServer and 4 seconds on Firebird Classic (the wrong plan is use in FireBird Classic)

is this a normal behavior ?

below some data :

*********************
*********************

1: windows vista 32 bit, Firebird SuperServer

Query Time
------------------------------------------------
Prepare : 0 ms
Execute : 0 sec
Avg fetch time: 0 ms

Memory
------------------------------------------------
Current: 9514964
Max : 11537508
Buffers: 2048

Operations
------------------------------------------------
Reads : 0
Writes : 0
Fetches: 312

Plan:
------------------------------------------------
PLAN JOIN (RESERVED_PERIOD INDEX (RDB$FOREIGN8), TRANSAC INDEX (RDB$PRIMARY129), PROPERTY_PUBLICATION INDEX (RDB$FOREIGN76))

Enchanced Info:
+--------------------------+-------+-----------+---------+---------+----------+
| Table Name | Index | Non-Index | Updated | Deleted | Inserted |
| | reads | reads | | | |
+--------------------------+-------+-----------+---------+---------+----------+
| RDB$INDEX_SEGMENTS| 2 | 0 | 0 | 0 | 0 |
| RDB$RELATION_CONSTRAINTS| 1 | 0 | 0 | 0 | 0 |
| RDB$PROCEDURES| 0 | 82 | 0 | 0 | 0 |
+--------------------------+-------+-----------+---------+---------+----------+

*********************
*********************

1: windows server 2008 64 bit, Firebird Classic

Query Time
------------------------------------------------
Prepare : 281 ms
Execute : 4.040 sec
Avg fetch time: 4,040.00 ms

Memory
------------------------------------------------
Current: 10173168
Max : 10288760
Buffers: 2048

Operations
------------------------------------------------
Reads : 338631
Writes : 2
Fetches: 13550104

Plan:
------------------------------------------------
PLAN JOIN (TRANSAC NATURAL, RESERVED_PERIOD INDEX (RDB$FOREIGN144), PROPERTY_PUBLICATION INDEX (RDB$FOREIGN76))

Enchanced Info:
+--------------------------+-------+-----------+---------+---------+----------+
| Table Name | Index | Non-Index | Updated | Deleted | Inserted |
| | reads | reads | | | |
+--------------------------+-------+-----------+---------+---------+----------+
| RDB$FIELDS| 65 | 0 | 0 | 0 | 0 |
| RDB$RELATION_FIELDS| 130 | 0 | 0 | 0 | 0 |
| RDB$RELATIONS| 15 | 0 | 0 | 0 | 0 |
| RDB$TRIGGERS| 8 | 0 | 0 | 0 | 0 |
| RDB$CHARACTER_SETS| 2 | 0 | 0 | 0 | 0 |
| RDB$COLLATIONS| 2 | 0 | 0 | 0 | 0 |
| RDB$PROCEDURES| 0 | 41 | 0 | 0 | 0 |
| RDB$FORMATS| 3 | 0 | 0 | 0 | 0 |
| RDB$SECURITY_CLASSES| 6 | 0 | 0 | 0 | 0 |
| RESERVED_PERIOD| 3,558 | 0 | 0 | 0 | 0 |
| TRANSAC| 0 | 1,048,572 | 0 | 0 | 0 |
+--------------------------+-------+-----------+---------+---------+----------+



thanks for you help

stephane

--
http://www.arkadia.com/fra/
http://www.arkadia.com/usa/
http://www.arkadia.com/rus/