Skip to content

Commit 3a72e3c

Browse files
quiesce-plan-cache (#521)
Summary: - Current implementation of plan cache provdes zero benefit. - Logic needs rework. - This change quiesces the plan cache until such time as the requisite work is prioritised.
1 parent f0d90de commit 3a72e3c

File tree

8 files changed

+17
-10
lines changed

8 files changed

+17
-10
lines changed

.github/goreleaser/.goreleaser-for-darwin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ builds:
2828
-X github.com/stackql/stackql/internal/stackql/cmd.BuildCommitSHA={{.FullCommit}}
2929
-X github.com/stackql/stackql/internal/stackql/cmd.BuildShortCommitSHA={{.ShortCommit}}
3030
-X github.com/stackql/stackql/internal/stackql/cmd.BuildDate={{.Date}}
31-
-X stackql/internal/stackql/planbuilder.PlanCacheEnabled=true
31+
-X stackql/internal/stackql/planbuilder.PlanCacheEnabled=false
3232
-X github.com/stackql/stackql/internal/stackql/cmd.BuildPlatform={{.Os}}
3333
3434
archives:

.github/goreleaser/.goreleaser-for-linux.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ builds:
3434
-X github.com/stackql/stackql/internal/stackql/cmd.BuildCommitSHA={{.FullCommit}}
3535
-X github.com/stackql/stackql/internal/stackql/cmd.BuildShortCommitSHA={{.ShortCommit}}
3636
-X github.com/stackql/stackql/internal/stackql/cmd.BuildDate={{.Date}}
37-
-X stackql/internal/stackql/planbuilder.PlanCacheEnabled=true
37+
-X stackql/internal/stackql/planbuilder.PlanCacheEnabled=false
3838
-X github.com/stackql/stackql/internal/stackql/cmd.BuildPlatform={{.Os}}
3939
4040
archives:

.github/goreleaser/.goreleaser-for-windows.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ builds:
2929
-X github.com/stackql/stackql/internal/stackql/cmd.BuildCommitSHA={{.FullCommit}}
3030
-X github.com/stackql/stackql/internal/stackql/cmd.BuildShortCommitSHA={{.ShortCommit}}
3131
-X github.com/stackql/stackql/internal/stackql/cmd.BuildDate={{.Date}}
32-
-X stackql/internal/stackql/planbuilder.PlanCacheEnabled=true
32+
-X stackql/internal/stackql/planbuilder.PlanCacheEnabled=false
3333
-X github.com/stackql/stackql/internal/stackql/cmd.BuildPlatform={{.Os}}
3434
3535
archives:

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ env:
3030
TESTSCRIPT: "test/python/main.py"
3131
GOPRIVATE: github.com/stackql/*
3232
GH_ACCESS_TOKEN: ${{ secrets.ACTIONS_PRIVATE_PACKAGE_SECRET }}
33-
PLANCACHEENABLED: "true"
33+
PLANCACHEENABLED: "false"
3434
CI_IS_EXPRESS: ${{ github.ref_type == 'tag' && contains(github.ref_name, 'express') && 'true' || 'false' }}
3535
STACKQL_IMAGE_NAME: ${{ vars.STACKQL_IMAGE_NAME != '' && vars.STACKQL_IMAGE_NAME || (github.repository == 'stackql/stackql' || github.repository == 'stackql/stackql-devel') && github.repository || 'stackql/stackql' }}
3636

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ARG BUILDPATCHVERSION="1"
2626
ARG BUILDCOMMITSHA="1"
2727
ARG BUILDSHORTCOMMITSHA="1"
2828
ARG BUILDDATE="1"
29-
ARG PLANCACHEENABLED="1"
29+
ARG PLANCACHEENABLED="false"
3030
ARG BUILDPLATFORM="1"
3131
ARG RUN_INTEGRATION_TESTS="1"
3232

@@ -115,7 +115,7 @@ ARG BUILDPATCHVERSION="1"
115115
ARG BUILDCOMMITSHA="1"
116116
ARG BUILDSHORTCOMMITSHA="1"
117117
ARG BUILDDATE="1"
118-
ARG PLANCACHEENABLED="1"
118+
ARG PLANCACHEENABLED="false"
119119
ARG BUILDPLATFORM="1"
120120
ARG RUN_INTEGRATION_TESTS
121121

cicd/python/build.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import os
77
import subprocess
88

9+
_DEFAULT_PLANCACHEENABLED = 'false'
10+
911

1012
def build_stackql(verbose :bool) -> int:
1113
os.environ['BUILDMAJORVERSION'] = os.environ.get('BUILDMAJORVERSION', '1')
@@ -19,7 +21,7 @@ def build_stackql(verbose :bool) -> int:
1921
f'-X github.com/stackql/stackql/internal/stackql/cmd.BuildCommitSHA={os.environ.get("BUILDCOMMITSHA", "")} '
2022
f'-X github.com/stackql/stackql/internal/stackql/cmd.BuildShortCommitSHA={os.environ.get("BUILDCOMMITSHA", "")[0:7 or None]} '
2123
f"-X 'github.com/stackql/stackql/internal/stackql/cmd.BuildDate={os.environ.get('BUILDDATE', '')}' "
22-
f"-X 'stackql/internal/stackql/planbuilder.PlanCacheEnabled={os.environ.get('PLANCACHEENABLED', '')}' "
24+
f"-X 'stackql/internal/stackql/planbuilder.PlanCacheEnabled={os.environ.get('PLANCACHEENABLED', _DEFAULT_PLANCACHEENABLED)}' "
2325
f'-X github.com/stackql/stackql/internal/stackql/cmd.BuildPlatform={os.environ.get("BUILDPLATFORM", "")}" '
2426
'-o build/ ./stackql',
2527
shell=True

docs/developer_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ As of now, `stackql` handles `xml` SERDE through the core, and does not route th
4848
## Building locally
4949

5050
```bash
51-
env CGO_ENABLED=1 go build \
51+
env CGO_ENABLED=1 PLANCACHEENABLED=false go build \
5252
--tags "sqlite_stackql" \
5353
-ldflags "-X github.com/stackql/stackql/internal/stackql/cmd.BuildMajorVersion=${BUILDMAJORVERSION:-1} \
5454
-X github.com/stackql/stackql/internal/stackql/cmd.BuildMinorVersion=${BUILDMINORVERSION:-1} \

internal/stackql/planbuilder/plan_builder.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,19 @@ import (
3030
"github.com/stackql/stackql-parser/go/vt/sqlparser"
3131
)
3232

33+
const (
34+
negativePlanCacheEnabled = "false"
35+
defaultPlanCacheEnabled = negativePlanCacheEnabled
36+
)
37+
3338
var (
3439
// only string "false" will disable.
35-
PlanCacheEnabled string = "true" //nolint:revive,gochecknoglobals // acceptable
40+
PlanCacheEnabled string = defaultPlanCacheEnabled //nolint:revive,gochecknoglobals // acceptable
3641
_ planGraphBuilder = &standardPlanGraphBuilder{}
3742
)
3843

3944
func isPlanCacheEnabled() bool {
40-
return strings.ToLower(PlanCacheEnabled) != "false"
45+
return strings.ToLower(PlanCacheEnabled) != negativePlanCacheEnabled
4146
}
4247

4348
type planGraphBuilder interface {

0 commit comments

Comments
 (0)