The issue here is you are using every for the whole pattern, hence this will output for every e1,e2 combination
from every (e1 = interfaceStatsEvents -> e2 = interfaceStatsEvents[nodeName == e1.nodeName and ifIndex == e1.ifIndex])
to get an output as you expected i.e for every e1 followed by e2 you have to change the query as
from every e1 = interfaceStatsEvents -> e2 = interfaceStatsEvents[nodeName == e1.nodeName and ifIndex == e1.ifIndex]
here the every will only apply for e1 and not for e1-e2 combination.