Amarok support of MySQL Embedded

Ian Monroe ian at monroe.nu
Sun Aug 31 23:03:59 CEST 2008


On Sat, Aug 30, 2008 at 2:57 PM, Edward Hades <edward.hades at gmail.com> wrote:
> On Sat, Aug 30, 2008 at 3:53 PM, Maximilian Kossick
> <maximilian.kossick at googlemail.com> wrote:
>> I'm not quite sure what you mean by "hitting the key limit in MyISAM".
>> Are some of our index names too long for mysql?
>
> No, the indexes themselves are too long.
>
> Consider, for example, this (DatabaseUpdater.cpp:333):
>
>        QString create = "CREATE TABLE urls "
>                         "(id " + m_collection->idType() +
>                         ",deviceid INTEGER"
>                         ",rpath " + m_collection->exactTextColumnType() +
>                         ",directory INTEGER"
>                         ",uniqueid " +
> m_collection->exactTextColumnType(128) + " UNIQUE);";
>        m_collection->query( create );
>        m_collection->query( "CREATE UNIQUE INDEX urls_id_rpath ON
> urls(deviceid, rpath);" );
>
> The rpath field is 1024 bytes long (or even bigger because of UTF),
> deviceid is some bytes long too (lets assume 4 bytes for simplicity),
> that makes index urls_id_rpath 1028 bytes long, while the default
> limit in mysql is 1000 bytes.

Ok, safe assumption: mysql devs knowledge of efficient indexes and
queries > us.

With our url table such an index shouldn't be needed.

Ian


More information about the Amarok-devel mailing list