Documentation ¶
Overview ¶
Copyright © 2020 Marvin
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.
Copyright © 2020 Marvin ¶
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.
Copyright © 2020 Marvin ¶
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.
Copyright © 2020 Marvin ¶
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.
Copyright © 2020 Marvin ¶
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 ¶
- func ExtractColumnMatchHistogram(matchIndexes []string, histogramMap map[string]Histogram) map[string]Histogram
- func FindColumnMatchConstraintIndexNames(consColumns map[string]string, compareField string, ignoreFields []string) []string
- type Bound
- type Bucket
- type Column
- type ConstraintCheck
- type ConstraintForeign
- type ConstraintPrimary
- type ConstraintUnique
- type Histogram
- type Index
- type NewColumn
- type OldColumn
- type Partition
- type Range
- type Rule
- type Selectivity
- type SequenceObjects
- type SortHistogram
- type SortHistograms
- type Table
- type TableObjects
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractColumnMatchHistogram ¶ added in v0.0.7
Types ¶
type Bound ¶
type Bound struct { ColumnName string `json:"columnName"` Collation string `json:"collation"` Datatype string `json:"datatype"` DatetimePrecision string `json:"datetimePrecision"` Lower string `json:"lower"` Upper string `json:"upper"` HasLower bool `json:"hasLower"` HasUpper bool `json:"hasUpper"` }
Bound represents a bound for a column
type Bucket ¶ added in v0.0.7
Bucket store the index statistics bucket
func StringSliceCreateBuckets ¶ added in v0.0.7
StringSliceCreateBuckets creates buckets from a sorted slice of strings. Each bucket's lower bound is the value of one element, and the upper bound is the next element's value. The last bucket will have the same upper bound as the previous bucket if there are no more elements.
type ConstraintCheck ¶
type ConstraintCheck struct {
ConstraintExpression string
}
type ConstraintForeign ¶
type ConstraintPrimary ¶
type ConstraintPrimary struct {
ConstraintColumn string
}
type ConstraintUnique ¶
type ConstraintUnique struct {
ConstraintColumn string
}
type NewColumn ¶
type OldColumn ¶
type OldColumn struct { Datatype string // complete origin data types, eg: number(20) DatatypeName string DataLength string DataPrecision string DatetimePrecision string // only mysql compatible database DataScale string NULLABLE string DataDefault string Charset string Collation string Comment string }
type Range ¶
type Range struct { DBType string `json:"dbType"` DBCharsetFrom string `json:"dbCharsetFrom"` // charset convert, from the charset (used to the data compare) DBCharsetDest string `json:"dbCharsetDest"` // charset convert, dest the charset (used to the data compare) Bounds []*Bound `json:"bounds"` BoundOffset map[string]int `json:"boundOffset"` }
Range represents chunk range
func NewChunkRange ¶ added in v0.0.7
NewChunkRange return a Range.
type Rule ¶ added in v0.0.7
type Rule struct { IndexColumnRule map[string]string ColumnDatatypeRule map[string]string ColumnCollationRule map[string]string DatetimePrecisionRule map[string]string }
Rule store the highest selectivity bucket upstream and downstream mapping rule, key is the database table column name
type Selectivity ¶ added in v0.0.9
type Selectivity struct { IndexName string IndexColumn []string ColumnDatatype []string ColumnCollation []string DatetimePrecision []string Buckets []Bucket }
Selectivity store the highest selectivity constraint or index bucket
func FindMatchDistinctCountBucket ¶ added in v0.0.7
func FindMatchDistinctCountBucket(sortHists SortHistograms, bucketMap map[string][]Bucket, consColumns map[string]string) (*Selectivity, error)
func (*Selectivity) String ¶ added in v0.0.9
func (h *Selectivity) String() string
func (*Selectivity) TransSelectivity ¶ added in v0.0.9
func (h *Selectivity) TransSelectivity(dbTypeS, dbCharsetS string, caseFieldRuleS string, enableCollationSetting bool) error
func (*Selectivity) TransSelectivityRule ¶ added in v0.0.9
type SequenceObjects ¶ added in v0.0.9
type SequenceObjects struct {
SequenceNames []string
}
type SortHistogram ¶ added in v0.0.7
type SortHistograms ¶ added in v0.0.7
type SortHistograms []SortHistogram
func SortDistinctCountHistogram ¶ added in v0.0.7
func SortDistinctCountHistogram(histogramMap map[string]Histogram, consColumns map[string]string) SortHistograms
func (SortHistograms) Len ¶ added in v0.0.7
func (s SortHistograms) Len() int
func (SortHistograms) Less ¶ added in v0.0.7
func (s SortHistograms) Less(i, j int) bool
func (SortHistograms) Swap ¶ added in v0.0.7
func (s SortHistograms) Swap(i, j int)
type Table ¶
type Table struct { SchemaName string TableName string TableComment string TableCharset string TableCollation string NewColumns map[string]NewColumn // columnNameNew -> NewColumn OldColumns map[string]map[string]OldColumn // originColumnName -> columnNameNew -> OldColumn Indexes map[string]Index // indexName -> Index PrimaryConstraints map[string]ConstraintPrimary // constraintName -> ConstraintPrimary UniqueConstraints map[string]ConstraintUnique // constraintName -> ConstraintUnique ForeignConstraints map[string]ConstraintForeign // constraintName -> ConstraintForeign CheckConstraints map[string]ConstraintCheck // constraintName -> ConstraintCheck Partitions []Partition }