Class: Google::Apis::SpannerV1::IndexAdvice

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/spanner_v1/classes.rb,
lib/google/apis/spanner_v1/representations.rb,
lib/google/apis/spanner_v1/representations.rb

Overview

Recommendation to add new indexes to run queries more efficiently.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ IndexAdvice

Returns a new instance of IndexAdvice.



2942
2943
2944
# File 'lib/google/apis/spanner_v1/classes.rb', line 2942

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#ddlArray<String>

Optional. DDL statements to add new indexes that will improve the query. Corresponds to the JSON property ddl

Returns:

  • (Array<String>)


2933
2934
2935
# File 'lib/google/apis/spanner_v1/classes.rb', line 2933

def ddl
  @ddl
end

#improvement_factorFloat

Optional. Estimated latency improvement factor. For example if the query currently takes 500 ms to run and the estimated latency with new indexes is 100 ms this field will be 5. Corresponds to the JSON property improvementFactor

Returns:

  • (Float)


2940
2941
2942
# File 'lib/google/apis/spanner_v1/classes.rb', line 2940

def improvement_factor
  @improvement_factor
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2947
2948
2949
2950
# File 'lib/google/apis/spanner_v1/classes.rb', line 2947

def update!(**args)
  @ddl = args[:ddl] if args.key?(:ddl)
  @improvement_factor = args[:improvement_factor] if args.key?(:improvement_factor)
end