Import time reduction

The cleanPositions method generates as many queries as you have
ps_feature entries.
So, repeat it by hundreds of products and your import should be very
long.

The above query avoids it (the import time is about 5 min for 900
products instead of more than 20 min).

(but the database user doesn't always have rights to use temporary tables)