Skip to main content

analyze_constraints

  • December 18, 2013
  • 1 reply
  • 9 views

Nebojsa_Zebelja
We've large tables and unfortunately the analyze_constraints() function is taking longer and longer!
We're doing every hour bulk data loading and afterwards verifying the data with the analyze_constraints() function.

Is there some kind of best practice, how I can do this more efficiently?
Just to analyze the data that is supposed to be uploaded and not the complete table every time.

Thanks in advance!

1 reply

Sharon_Cutter
Forum|alt.badge.img
  • Participating Frequently
  • December 19, 2013
What constraints do you have defined?  I'll guess that it's a primary key and that the time is being spent checking for uniqueness.  If you EXPLAIN the analyze_constraints() you can see the query plan.   You can optimize the primary key check by optimizing for that GROUP BY - it may mean adding another pair of projections depending on what your current projections optimize for.

  --Sharon