I now tried this, and GIN turned out to be linear time, compared with GIST which was acceptable time. However I tested this only for Z=infinity, for Z=1000, GIST/GIN are both not acceptable.Did you try integer arrays with GIN (inverted index) ?
---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster