func (a *appStats) shouldSaveLogicalPlanDescription(
	stmt *Statement, useDistSQL bool, vectorized bool, implicitTxn bool, err error,
) bool {
	if !sampleLogicalPlans.Get(&a.st.SV) {
		return false
	}
	stats := a.getStatsForStmt(
		stmt, useDistSQL, vectorized, implicitTxn,
		err, false, /* createIfNonexistent */
	)
	if stats == nil {
		// Save logical plan the first time we see new statement fingerprint.
		return true
	}
	now := timeutil.Now()
	period := logicalPlanCollectionPeriod.Get(&a.st.SV)
	stats.Lock()
	defer stats.Unlock()
	timeLastSampled := stats.data.SensitiveInfo.MostRecentPlanTimestamp
	return now.Sub(timeLastSampled) >= period
}
// shouldSaveLogicalPlanDescription returns whether we should save this as a
// sample logical plan for its corresponding fingerprint. We use
// `logicalPlanCollectionPeriod` to assess how frequently to sample logical
// plans.
shouldSaveLogicalPlanDescription returns whether we should save this as a
sample logical plan for its corresponding fingerprint. We use
`logicalPlanCollectionPeriod` to assess how frequently to sample logical
plans.
// shouldSaveLogicalPlanDescription returns whether we should save this as a // sample logical plan for its corresponding fingerprint . We use // ` logicalPlanCollectionPeriod ` to assess how frequently to sample logical // plans .
func (a *appStats) shouldSaveLogicalPlanDescription(
	stmt *Statement, useDistSQL bool, vectorized bool, implicitTxn bool, err error,
) bool {
	if !sampleLogicalPlans.Get(&a.st.SV) {
		return false
	}
	stats := a.getStatsForStmt(
		stmt, useDistSQL, vectorized, implicitTxn,
		err, false, 
	)
	if stats == nil {
		return true
	}
	now := timeutil.Now()
	period := logicalPlanCollectionPeriod.Get(&a.st.SV)
	stats.Lock()
	defer stats.Unlock()
	timeLastSampled := stats.data.SensitiveInfo.MostRecentPlanTimestamp
	return now.Sub(timeLastSampled) >= period
}
func ( a * appStats ) shouldSaveLogicalPlanDescription ( stmt * Statement , useDistSQL bool , vectorized bool , implicitTxn bool , err error , ) bool { if ! sampleLogicalPlans . Get ( & a . st . SV ) { return false } stats := a . getStatsForStmt ( stmt , useDistSQL , vectorized , implicitTxn , err , false , ) if stats == nil { return true } now := timeutil . Now ( ) period := logicalPlanCollectionPeriod . Get ( & a . st . SV ) stats . Lock ( ) defer stats . Unlock ( ) timeLastSampled := stats . data . SensitiveInfo . MostRecentPlanTimestamp return now . Sub ( timeLastSampled ) >= period }
shouldSaveLogicalPlanDescription returns whether we should save this as a
sample logical plan for its corresponding fingerprint.
shouldSaveLogicalPlanDescription returns whether we should save this as a sample logical plan for its corresponding fingerprint .
/* createIfNonexistent */ // Save logical plan the first time we see new statement fingerprint.