The core performance problem is the selectivity estimation for the predicate `path ilike '%cat%'`, which is off by a factor of 130:

> (cost=0.00..809.15 **rows=1753** width=0) (actual time=2108.286..2108
.286 **rows=223590** loops=1)                                     

Probably leading to a sub-optimal query plan.

Selectivity estimation for pattern matching is hard, but there have been major improvements in Postgres 9.6. Detailed explanation in this closely related answer:

- https://dba.stackexchange.com/questions/138288/trigram-index-for-for-ilike-patterns-not-working-as-expected

Your best course of action *may* be to install a current version of Postgres.

Of course, there may be all kinds of additional problems, your question does not reveal details.

Or you may be using the wrong tool altogether, you did not define what you are trying to search exactly.