Optimering af intersect query
Er der nogle kloge hoveder, som kan optimere følgende query:(SELECT barcode FROM (SELECT TOP 50 barcode, ABS(rssi-10) AS dist FROM itemLocation WHERE mac=1 ORDER BY dist) AS result) INTERSECT
(SELECT barcode FROM (SELECT TOP 50 barcode, ABS(rssi-10) AS dist FROM itemLocation WHERE mac=2 ORDER BY dist) AS result) INTERSECT
(SELECT barcode FROM (SELECT TOP 50 barcode, ABS(rssi-10) AS dist FROM itemLocation WHERE mac=3 ORDER BY dist) AS result)
Table itemLocation:
barcode | mac | rssi