PostgreSQL also has built-in support for exact (as opposed to approximate) vector similarity search for some problems with the following constraints:
- 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.