and ST_DWithin(ST_SetSRID(ST_MakePoint(e1.longitude, e1.latitude), 4326),ST_MakePoint(e.longitude, e.latitude)::geography, 1000) ;
Is it a good practice to iterate the rows of the table like I did and does not have an effect in the performance if the number of table's rows increase?