[MDEV-4781] Using DISTINCT on composite key disable usage of loose scan optimisation Created: 2013-07-12 Updated: 2014-06-06 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.31 |
| Fix Version/s: | 5.5 |
| Type: | Bug | Priority: | Minor |
| Reporter: | VAROQUI Stephane | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Index on productId,tsExpires
|
| Comments |
| Comment by VAROQUI Stephane [ 2013-07-12 ] |
|
It could also be possible to use index loose scan adding any condition to the query not covered inside the composite index. It should be possible to make ICP works with loose index scan . Jumping to the index , range scan until ICP condition match and repeat over and over . This may get better cost than the full range index scan. We can imagine 2 cases : |
| Comment by VAROQUI Stephane [ 2013-07-12 ] |
|
It could also be possible to use loose index scan in case of equ_ref, if joining only with columns of the aggregate . In that case we can rewrite join to EXISTS or IN subquery and evaluate subquery after the loose scan aggregation. |