In case you have your own slow SQL query, you can optimize it automatically here.
For the query above, the following recommendations will be helpful as part of the SQL tuning process.
You'll find 3 sections below:
SELECT
a,
b,
c
FROM
((SELECT
table.hstore->'a' AS a,
table.hstore->'b' AS b,
table.hstore->'c' AS c
FROM
table
WHERE
table.hstore->'z' ILIKE '123%')
UNION
DISTINCT (SELECT
table.hstore->'a' AS a,
table.hstore->'b' AS b,
table.hstore->'c' AS c
FROM
table
WHERE
table.hstore->'y' ILIKE '123%')
UNION
DISTINCT (SELECT
table.hstore->'a' AS a,
table.hstore->'b' AS b,
table.hstore->'c' AS c
FROM
table
WHERE
table.hstore->'x' ILIKE '123%')
) AS union1