github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/sql/opt/view_dependencies.go (about)

     1  // Copyright 2019 The Cockroach Authors.
     2  //
     3  // Use of this software is governed by the Business Source License
     4  // included in the file licenses/BSL.txt.
     5  //
     6  // As of the Change Date specified in that file, in accordance with
     7  // the Business Source License, use of this software will be governed
     8  // by the Apache License, Version 2.0, included in the file
     9  // licenses/APL.txt.
    10  
    11  package opt
    12  
    13  import (
    14  	"github.com/cockroachdb/cockroach/pkg/sql/opt/cat"
    15  	"github.com/cockroachdb/cockroach/pkg/util"
    16  )
    17  
    18  // ViewDeps contains information about the dependencies of a view.
    19  type ViewDeps []ViewDep
    20  
    21  // ViewDep contains information about a view dependency.
    22  type ViewDep struct {
    23  	DataSource cat.DataSource
    24  
    25  	// ColumnOrdinals is the set of column ordinals that are referenced by the
    26  	// view for this table. In most cases, this consists of all "public" columns
    27  	// of the table; the only exception is when a table is referenced by table ID
    28  	// with a specific list of column IDs.
    29  	ColumnOrdinals util.FastIntSet
    30  
    31  	// If an index is referenced specifically (via an index hint), SpecificIndex
    32  	// is true and Index is the ordinal of that index.
    33  	SpecificIndex bool
    34  	Index         cat.IndexOrdinal
    35  }