quicker self information calculations by using sqldf queries