the postgres trick is to use partial index on the column to improve the
query speed.
1. create a substring index on the table, lets say 5 characters wide:
CREATE INDEX speed_shortuuid ON table(substr(shortuuid, 0, 5)
2. have all queries include a match against that index, calculating the
I do not know the optimization trick. I'd be interested to know! It would
be nice to not have to translate to and from the UUID type.
On Friday, May 19, 2017 at 4:04:55 PM UTC-7, Jonathan Vanasco wrote:
>
> side question - have you done any tests on how the UUID type queries as
> your
side question - have you done any tests on how the UUID type queries as
your database scales? It may make sense to do the shortuuid as a text
field, which you can put a substring index on. if you don't know that
postgresql optimization trick, I can explain it further.
--
SQLAlchemy -
The