graphql-engine/server/src-lib/Hasura/Server
Auke Booij 7bead93827 server: remove remnants of query plan caching (fix #1795)
Query plan caching was introduced by - I believe - hasura/graphql-engine#1934 in order to reduce the query response latency. During the development of PDV in hasura/graphql-engine#4111, it was found out that the new architecture (for which query plan caching wasn't implemented) performed comparably to the pre-PDV architecture with caching. Hence, it was decided to leave query plan caching until some day in the future when it was deemed necessary.

Well, we're in the future now, and there still isn't a convincing argument for query plan caching. So the time has come to remove some references to query plan caching from the codebase. For the most part, any code being removed would probably not be very well suited to the post-PDV architecture of query execution, so arguably not much is lost.

Apart from simplifying the code, this PR will contribute towards making the GraphQL schema generation more modular, testable, and easier to profile. I'd like to eventually work towards a situation in which it's easy to generate a GraphQL schema parser *in isolation*, without being connected to a database, and then parse a GraphQL query *in isolation*, without even listening any HTTP port. It is important that both of these operations can be examined in detail, and in isolation, since they are two major performance bottlenecks, as well as phases where many important upcoming features hook into.

Implementation

The following have been removed:
- The entirety of `server/src-lib/Hasura/GraphQL/Execute/Plan.hs`
- The core phases of query parsing and execution no longer have any references to query plan caching. Note that this is not to be confused with query *response* caching, which is not affected by this PR. This includes removal of the types:
- - `Opaque`, which is replaced by a tuple. Note that the old implementation was broken and did not adequately hide the constructors.
- - `QueryReusability` (and the `markNotReusable` method). Notably, the implementation of the `ParseT` monad now consists of two, rather than three, monad transformers.
- Cache-related tests (in `server/src-test/Hasura/CacheBoundedSpec.hs`) have been removed .
- References to query plan caching in the documentation.
- The `planCacheOptions` in the `TenantConfig` type class was removed. However, during parsing, unrecognized fields in the YAML config get ignored, so this does not cause a breaking change. (Confirmed manually, as well as in consultation with @sordina.)
- The metrics no longer send cache hit/miss messages.

There are a few places in which one can still find references to query plan caching:

- We still accept the `--query-plan-cache-size` command-line option for backwards compatibility. The `HASURA_QUERY_PLAN_CACHE_SIZE` environment variable is not read.

https://github.com/hasura/graphql-engine-mono/pull/1815

GitOrigin-RevId: 17d92b254ec093c62a7dfeec478658ede0813eb7
2021-07-27 11:52:43 +00:00
..
API Clean metadata arguments 2021-07-27 10:42:51 +00:00
Auth server: misc cleanups 2021-06-15 15:06:37 +00:00
Init server: remove remnants of query plan caching (fix #1795) 2021-07-27 11:52:43 +00:00
Migrate server: source initialization fix 2021-05-31 13:54:59 +00:00
Telemetry server: remove remnants of query plan caching (fix #1795) 2021-07-27 11:52:43 +00:00
Version server: reorganise version embedding for fewer [TH] rebuilds 2021-06-29 16:40:47 +00:00
App.hs server: remove remnants of query plan caching (fix #1795) 2021-07-27 11:52:43 +00:00
Auth.hs server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
CheckUpdates.hs server: simplify JSON instances 2021-01-19 19:15:42 +00:00
Compression.hs server: move Hasura.SQL to Hasura.Backends.Postgres (#6053) 2020-10-27 13:53:49 +00:00
Cors.hs server: support custom URI schemes in CORS config (fix #5818) 2021-05-06 00:53:14 +00:00
Init.hs server: remove remnants of query plan caching (fix #1795) 2021-07-27 11:52:43 +00:00
Logging.hs server: log query in http-log/ws-log only if query-log is enabled 2021-07-13 12:24:19 +00:00
Middleware.hs Migrate to GHC 8.10, upgrade dependencies. Closes #4517 2020-05-13 19:13:02 -04:00
Migrate.hs server: source initialization fix 2021-05-31 13:54:59 +00:00
Rest.hs server: log request type (batched/single) in http-log 2021-07-05 09:46:29 +00:00
SchemaUpdate.hs server: update the logging strategy for inconsistent metadata 2021-07-27 05:42:05 +00:00
Telemetry.hs server: switch to a sub-backend approach 2021-04-21 21:45:32 +00:00
Types.hs server: log additional info in the livequery poller logs 2021-06-16 13:28:17 +00:00
Utils.hs Revert "remote schema typename customisation" 2021-06-10 09:57:16 +00:00
Version.hs server: reorganise version embedding for fewer [TH] rebuilds 2021-06-29 16:40:47 +00:00