Hi

> Unfortunately it proves to be harder than I first thought because:
>   * resources.title is a TEXT column
>   * mysql can't create an index over a (complete) TEXT column
>
> However, since MySQL 5.0.3 (an old version), it is possible to:
>   * define larger than 255 character VARCHARs
>   * use those on index as long as the index is not more than 767 chars
> on innodb or 1000 chars on MyISAM.
>
> Since any version back to 3.23 it is possible to have index on TEXT
> columns as long as we use a prefix length (50 for the current index).
>
> That means, either we had specific code for MySQL (and even specific
> version) or we get rid of the idea of such index.

I assume that MySQL is the most used rdbms for puppetmaster, or maybe  
it is postgres? Anyway there might be users who would still use MySQL  
4.X but is anybody using < 4?
Maybe we could say that we support this feature only for versions >=  
5.0.3 or would this be too tricky or would it simply not worth to  
distinguish?

> Maybe I'm raising warnings for nothing as the longest title length I
> have in my environment is 109 characters.
>
> I'd be interested if other people could send me their longest title
> length, which can be computed by:
> SELECT MAX(LENGTH(title)) FROM resources;

on one environment

198

and on the other

100

> Something along the line of:
> CREATE UNIQUE INDEX tth_idx ON resources(title(255),restype,host_id);
> should work on most platform I think (at least it works on mine).

mysql> CREATE UNIQUE INDEX tth_idx ON resources(title(255),restype,host_id);
Query OK, 16012 rows affected (1.94 sec)
Records: 16012  Duplicates: 0  Warnings: 0

this is for the environment which I cleaned up, hence encountered the  
discussed problem. For a clean environment it works fine.

another environment is still on 0.24.5 and this one reported duplicate  
entries, while trying to create the index. so there's at least another  
environment where we still have the problem. If you'd like me to do  
any additional tests there before or after upgrading to latest head,  
please let me know. I assume to do the upgrade next week.
I'm currently trying to remember what might be the best way to clean  
that environment from the duplicate entries.

cheers Pete

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com
To unsubscribe from this group, send email to 
puppet-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to