First & Last touch

Is there any other efficient way to query this data?