7 ms·
Sometimes what bothers me is I sometimes have no idea if a query is slow or not. This holds more true since I've been developing on Rails with Postgres. With My
by easy_rider 12y ago
Sometimes what bothers me is I sometimes have no idea if a query is slow or not. This holds more true since I've been developing on Rails with Postgres. With MySQL it seems the bottleneck queries seem a lot more exponentially progressively degrading in correlation to the amount of records in a set.
With Postgres this seems to be a lot more linear.
I have just made some crafty work in rails to make use of hstore datatypes in Rails. It stores an array of hashes, which I have not found a way to index the keys of yet.
Is this slow or fast for example?
I'm doing a full-text search over all unnested (hstore) array values over a given column in a table wih 35k records.
development=# SELECT "leads".* FROM "leads" WHERE ( exists ( select * from (SELECT svals(unnest("address"))) x(item) where x.item LIKE '%mst%') );
Time: 57.257 ms
I'm used to MySQL, and this kind of query over unindexed records seems fast, but it also seems this might be slow for Postgres standards ?:/
Bear in mind.. no indices.
- jeffasinger 12y agoWith postgres, you should be able to use a GIN index anything that's returned by an immutable function. You may have to write a function that does what you want and Mark it as immutable.
- easy_rider 12y agoYes! haven't dived into it, but the possibility made me go for it regardless. Have been quite impressed with pg's performance with a lot of things you wouldn't want to mess with in mysql.