graphql-engine icon indicating copy to clipboard operation
graphql-engine copied to clipboard

Prevent expensive views from being naively COUNTed by Hasura Console

Open bitjson opened this issue 3 years ago • 2 comments

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!

bitjson avatar Apr 09 '21 22:04 bitjson

Estimated counts would be acceptable in my situation...

Related to:

#5010 #4899 #3793

austinnichols101 avatar Apr 13 '21 11:04 austinnichols101

@bitjson We have made a lot of performance improvements since this ticket was filed. Are you still experiencing this issue?

dameleney avatar Sep 20 '22 14:09 dameleney

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.

dameleney avatar Jun 22 '23 14:06 dameleney