List:Internals« Previous MessageNext Message »
From:Zardosht Kasheff Date:October 10 2012 6:23pm
Subject:purpose of KEY->rec_per_key
View as plain text  
Hello,

In a the structure KEY, I see a field named rec_per_key that has the
following comment:

  /*
    Array of AVG(#records with the same field value) for 1st ... Nth key part.
    0 means 'not known'.
    For temporary heap tables this member is NULL.
  */

Our storage engine does not ever fill these values. We set the values
to 0. We recently saw that not setting this for the primary key
resulted in a bad query plan. We can set it to 1 for unique keys and
the primary key. Are there other known bad side effects to not setting
this?

Thanks
-Zardosht
Thread
purpose of KEY->rec_per_keyZardosht Kasheff10 Oct
  • Re: purpose of KEY->rec_per_keySergei Golubchik10 Oct
    • Re: purpose of KEY->rec_per_keyZardosht Kasheff10 Oct
      • Re: purpose of KEY->rec_per_keySergei Golubchik10 Oct
        • Re: purpose of KEY->rec_per_keyZardosht Kasheff12 Oct
          • Re: purpose of KEY->rec_per_keySergei Golubchik12 Oct