Announcement

Announcement Module
Collapse
No announcement yet.

char based partitioning

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • char based partitioning

    Hi,
    I have huge table like 20mln records in 50 columns.
    I want to partition this table by char field.

    mysql> describe hist;
    +------------+----------+------+-----+---------+-------+
    | Field | Type | Null | Key | Default | Extra |
    +------------+----------+------+-----+---------+-------+
    | SHOP | char(20) | YES | MUL | NULL | |

    So i have 20 different shops and they are like Wexford, Waterford etc and want to have one partition per one shop. Is it possible to do ? I saw few examples with ASCII() function but it takes only first character from string so 2 abovementioned shops will be in same partition what i want to avoid. Is there any function which make a integer hash from char field ? even taking 2 first characters from shop name would help me. regards

    Michal

  • #2
    are you talking about mysql's substring?

    http://dev.mysql.com/doc/refman/5.0/en/string-functions.html

    Comment

    Working...
    X