[Teneo] Redundant indexes in database [message #909083] |
Thu, 06 September 2012 13:55 |
Eclipse User |
|
|
|
I'm using Eclipse 4.2 and Teneo. When I browse the database in
phpmyadmin, I'm seeing lots of warning messages like these:
"The indexes MyClass_attribute and mypkg_myclass_attribute seem to be
identical and one of them could possibly be removed."
I am using the QualifyingEntityNameStrategy.
Is there a way suppress the non-qualified indexes?
TIA
Marius
|
|
|
|
Re: [Teneo] Redundant indexes in database [message #909096 is a reply to message #909087] |
Thu, 06 September 2012 14:17 |
Eclipse User |
|
|
|
Hello Martin,
On 06.09.2012 16:02, Martin Taal wrote:
> Hi Marius,
> Hmm, teneo/hibernate will not remove existing indexes, is it possible
> that some of these indexes are from a previous run with a different
> option setting?
No, I have dropped/created the database.
> Can you generated/check the hbm to see if indeed indexes are duplicated?
Well, its mostly black magic to me but...
<key update="true" foreign-key="mypkg_myclass_attribute">
<column name="`myclass_attribute_id`" unique="false"
index="mypkg.MyClass_attribute"/>
</key>
<list-index column="`myclass_attribute_idx`"/>
.... could the definition index= and list-index be the cause for this?
Regards
Marius
|
|
|
Re: [Teneo] Redundant indexes in database [message #909270 is a reply to message #909096] |
Thu, 06 September 2012 21:01 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
He Marius,
No the list-index holds the index number in the list.
I wonder where the MyClass_attribute index is coming from...
You can disable foreign key generation in the hbm by setting this option to false:
teneo.naming.set_foreign_key_name
(default is true).
gr. Martin
On 09/06/2012 04:17 PM, Marius Gröger wrote:
> Hello Martin,
>
> On 06.09.2012 16:02, Martin Taal wrote:
>> Hi Marius,
>> Hmm, teneo/hibernate will not remove existing indexes, is it possible
>> that some of these indexes are from a previous run with a different
>> option setting?
>
> No, I have dropped/created the database.
>
>> Can you generated/check the hbm to see if indeed indexes are duplicated?
>
> Well, its mostly black magic to me but...
>
> <key update="true" foreign-key="mypkg_myclass_attribute">
> <column name="`myclass_attribute_id`" unique="false"
> index="mypkg.MyClass_attribute"/>
> </key>
> <list-index column="`myclass_attribute_idx`"/>
>
> .... could the definition index= and list-index be the cause for this?
>
> Regards
> Marius
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
|
Re: [Teneo] Redundant indexes in database [message #909470 is a reply to message #909270] |
Fri, 07 September 2012 07:45 |
Eclipse User |
|
|
|
On 06.09.2012 23:01, Martin Taal wrote:
> I wonder where the MyClass_attribute index is coming from...
>
> You can disable foreign key generation in the hbm by setting this
> option to false: teneo.naming.set_foreign_key_name
Thanks for the pointer in this direction. Actually I found out that for
some historic reason I had set up the store with add_index_for_fk=true.
If I switch this to false, the duplicates go away.
Regards
Marius
|
|
|
Powered by
FUDForum. Page generated in 0.02486 seconds