Hello,

it's normal that only the indexes on one table is used during an inner 
join ?

for exemple :

table a

ID => pk_index
DATE => index a_date => selectivity : 0.1
NAME => index a_name selectivity :0.1

table b :

REFIDA => fk_index
REFPRODUIT => index b_produit => selectivity : 0.2
NAME => index b_name => selectivity : 0.2

REQUEST :

select name from a inner join b on (REFIDA = ID) WHERE a.DATE > 
'01.01.2000' and b.name = 'fb_server' and b.refproduit = 'azaza';

in the plan analyser only the index of a.date is used (a_date) not the 
b.name (b_name) and b.refproduit(b_produit) indexes.

i think it takes the table that have the index with the best 
selectivity. because if for exemple b_produit index have a best 
selectivity that "a_date index" the two indexes of table B ares used and 
not this on table a.

it' s normal ? is there a solution for take all index during an inner join ?

thanks in advance.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to