NTFS Filesystem Fragmentation issue occur after migrating mysql 5.6 database to mariadb 10.2
This is a bug, which I filed and fixed, based on this question. BTW, we do have a bug system too, do not hesitate to use it directly.

Here is the bug report. https://jira.mariadb.org/browse/MDEV-13941

Basically, fragments are created because sparse file is being extended. The fix is not to create sparse files, unless user wants a table with page compression (which is an exotic feature that not many people would use). The fix will appear in the next 10.2 (i.e 10.2.10), mid-end October.

However, just the upgrade to 10.2.10 won't automatically fix  the problem for existing tables. There is something else you need to do prior to installation of 10.2.10


Stop the server
Unset the "sparse flag" on .idb files. in elevated command prompt, type

fsutil sparse setflag C:\path\to\table.ibd 0

Defragment file with contig (or other tools)