Cardinality?

Discussion in 'MySQL' started by Joobz, Jun 14, 2007.

  1. #1
    I am having a hard time understanding what Cardinality means in terms of indexes for mySQL database. I have a database that has an index where the column named "Cardinality" has a value of 47,417. Consequently, I can not import more than 47,417 rows into that database. Seems a little more than coincidence to me.
     
    Joobz, Jun 14, 2007 IP
  2. flippers.be

    flippers.be Peon

    Messages:
    432
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The cardinality of a column is the number of distinct values that it contains.

    It's not a limit.
    If you add one new row to the column, cardinality will increase with one (it isn't always updated, run 'analyze table')
     
    flippers.be, Jun 14, 2007 IP
  3. Joobz

    Joobz Peon

    Messages:
    598
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I am wondering then, why my database only imports up to 47,417 rows and no more. It errors out after attempting to import more than 47,417 rows. I checked my hosting limits and there were none that would affect this. Is there something else?
     
    Joobz, Jun 15, 2007 IP
  4. bochgoch

    bochgoch Peon

    Messages:
    1,918
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You probably have a dodgy 47,418th row in your data -- the wrong number of columns or an inappropriate value in one of the columns. Open the data in an editor, find the row, take a look and correct it.
     
    bochgoch, Jun 15, 2007 IP
  5. flippers.be

    flippers.be Peon

    Messages:
    432
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    What is the exact error message ??
     
    flippers.be, Jun 15, 2007 IP
  6. Joobz

    Joobz Peon

    Messages:
    598
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Yep, that was it, an apostrophe in one of the names - thanks for the heads-up
     
    Joobz, Jun 15, 2007 IP
  7. Joobz

    Joobz Peon

    Messages:
    598
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Fatal error: Maximum execution time of 300 seconds exceeded in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/string.lib.php on line 91

    I didn't think this error message was indicative of the actual problem though so I hadn't mentioned it before
     
    Joobz, Jun 15, 2007 IP