graphql-engine
graphql-engine copied to clipboard
Prevent expensive views from being naively COUNTed by Hasura Console
I have several fairly complex views which compute data from much larger tables (~100 GBs) to support some relationships in the autogenerated API.
When I navigate to these view in Hasura Console (e.g. /console/data/default/schema/public/views/expensive_view/browse
), this sort of query is issued:
SELECT COUNT(*) FROM (SELECT * FROM "public"."expensive_view" WHERE ('true') ) AS "r"
Is it possible to configure Hasura Console to disable this counting for particular views?
The first 10 rows show almost instantly (which is really nice), but because of the counting in the background, the progress bar is shown and the server lags until I kill the query from the server side.
Thanks!
Estimated counts would be acceptable in my situation...
Related to:
#5010 #4899 #3793
@bitjson We have made a lot of performance improvements since this ticket was filed. Are you still experiencing this issue?
Closing this issue. Significant changes have been made to the browse rows UI and introspection that should prevent these types of expensive queries from being executed on a database as part of the Hasura integration.