• Jeff Moden (6/28/2008)


    about 300-million rows

    That's kinda what I thought you were going to say.

    What I was suggesting is that the distance from Point A to Point B is exactly the same as the distance from Point B to Point A... wouldn't that cut your row count about in half if you did it like half a multiplication table for each "group"?

    It's already one-way. The two tables have completely different data in them. No self-join at all. A to B or B to A, it's the same number of calculations in what I'm doing. And I'm already filtering for lat/long outside of the possible distances range, etc. (otherwise, it would be a full cartesian). It's a question of taking a large number of addresses in one list, and finding the four closest addresses in a different list for each one in the first list. There's no overlap in the two lists.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon