Subject | Is this query using an index? |
---|---|
Author | firebirdsql |
Post date | 2011-09-23T03:39:30Z |
Flamerobin shows the plan as:
PLAN JOIN (users NATURAL, group_users INDEX (INTEG_14))
Also, I got the following tables:
Group users key (composite): col1, col2, col5
Users key: col2, col3
When I do an inner join between the two tables I get:
PLAN JOIN (users NATURAL, group_users INDEX (INTEG_14))
How can that use an index when the full composite key of users (col2, col3) is not defined for groups. Only partial col2 is defined. And because col1 is the first column in the composite key index, how come firebird uses the index?
(the tables have no rows, I'm just using the show plan option in flamerobin)
PLAN JOIN (users NATURAL, group_users INDEX (INTEG_14))
Also, I got the following tables:
Group users key (composite): col1, col2, col5
Users key: col2, col3
When I do an inner join between the two tables I get:
PLAN JOIN (users NATURAL, group_users INDEX (INTEG_14))
How can that use an index when the full composite key of users (col2, col3) is not defined for groups. Only partial col2 is defined. And because col1 is the first column in the composite key index, how come firebird uses the index?
(the tables have no rows, I'm just using the show plan option in flamerobin)