Skip to content

Instantly share code, notes, and snippets.

View Tim-Schwalbe's full-sized avatar
🤠

Tim Schwalbe Tim-Schwalbe

🤠
View GitHub Profile
@Tim-Schwalbe
Tim-Schwalbe / gist:23ca6e3ee4968c954e3b2367c1c9edc8
Created May 19, 2021 10:23
Optimize multiple MySQL Tables
set @tables_like = "%table_name%";
set @optimize = null;
set @show_tables = concat("show tables where", ifnull(concat(" `Tables_in_", database(), "` like '", @tables_like, "' and"), ''), " (@optimize:=concat_ws(',',@optimize,`Tables_in_", database() ,"`))");
Prepare `bd` from @show_tables;
EXECUTE `bd`;
DEALLOCATE PREPARE `bd`;
set @optimize := concat('optimize table ', @optimize);
PREPARE `sql` FROM @optimize;
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "name" . }}
labels:
app: {{ template "name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
annotations:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "name" . }}
labels:
app: {{ template "name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
annotations:
https://editor.cilium.io/?id=AJ8LtZ3h9SCP1MKC