- you have smaller vectors (no more than 50D)
- Euclidean, taxicab, or Chebyshev distance is appropriate for your problem
Put a GiST index [0] on a cube column [1] and ORDER BY target_cube_value <-> cube_column.
[0] https://www.postgresql.org/docs/current/gist.html
[1] https://www.postgresql.org/docs/current/cube.html