Are there highly efficient C extensions out there for math operations on arrays? Dot product and whatnot.
what you mean "highly efficient" ?
Implemented as a C module so I wont have to unnest or plpgsql.
ok,
I don't know any extension that calculate euclid distance, but it should be trivial in C - if you don't need to use generic types and generic operations.