Documentation
¶
Overview ¶
Package cmd
Copyright © 2024 Rohat Sahin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package cmd ¶
Copyright © 2024 Rohat Sahin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package cmd ¶
Copyright © 2024 Rohat Sahin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package cmd ¶
Copyright © 2024 Rohat Sahin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package cmd ¶
Copyright © 2024 Rohat Sahin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package cmd ¶
Copyright © 2024 Rohat Sahin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package cmd ¶
Copyright © 2024 Rohat Sahin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package cmd ¶
Copyright © 2024 Rohat Sahin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package cmd ¶
Copyright © 2024 Rohat Sahin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package cmd ¶
Copyright © 2024 Rohat Sahin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BatchReport ¶
type BatchReport struct {
FileName string `json:"file_name"`
TotalQueries int `json:"total_queries"`
SuccessCount int `json:"success_count"`
FailureCount int `json:"failure_count"`
Results []BatchResult `json:"results"`
GeneratedAt time.Time `json:"generated_at"`
}
BatchReport stores all batch analysis results
type BatchResult ¶
type BatchResult struct {
QueryNumber int `json:"query_number"`
Query string `json:"query"`
ExecutionPlan string `json:"execution_plan"`
CostAnalysis *CostInfo `json:"cost_analysis,omitempty"`
Error string `json:"error,omitempty"`
GeneratedAt time.Time `json:"generated_at"`
}
BatchResult stores the analysis result for a single query
type ComparisonResult ¶
type ComparisonResult struct {
Query1 string `json:"query1"`
Query2 string `json:"query2"`
Plan1 string `json:"plan1"`
Plan2 string `json:"plan2"`
Cost1 *CostInfo `json:"cost_analysis1"`
Cost2 *CostInfo `json:"cost_analysis2"`
Winner string `json:"winner"`
CostDiff float64 `json:"cost_difference"`
CostDiffPct float64 `json:"cost_difference_percentage"`
Recommendation string `json:"recommendation"`
}
type Config ¶
type Config struct {
Defaults struct {
Format string `yaml:"format"`
Threshold float64 `yaml:"threshold"`
Remote bool `yaml:"remote"`
} `yaml:"defaults"`
Database struct {
Host string `yaml:"host"`
User string `yaml:"user"`
Database string `yaml:"database"`
Password string `yaml:"password"`
} `yaml:"database"`
}
type CostInfo ¶
type CostInfo struct {
TotalCost float64
ExpensiveOps []ExpensiveOperation
ExceedsLimit bool
ThresholdValue float64
}
type ExpensiveOperation ¶
type IndexRecommendation ¶
type IndexRecommendation struct {
TableName string
Columns []string
IndexType string
Reason string
OperationType string
OperationCost float64
CreateStatement string
Priority int
}
IndexRecommendation represents a single index recommendation
type IndexRecommendationInfo ¶
type IndexRecommendationInfo struct {
Recommendations []IndexRecommendation
TotalFound int
HighPriority int
ThresholdUsed float64
}
IndexRecommendationInfo aggregates all recommendations
type OperationContext ¶
type OperationContext struct {
Line string
OperationType string
TableName string
FilterColumns []string
JoinColumns []string
SortColumns []string
Cost float64
RowsEstimate int64
}
OperationContext holds parsed information about a single EXPLAIN line