cancel
Showing results for 
Search instead for 
Did you mean: 

Add index on LP tables (Localized Tables)

pratik_a_soni
Participant
0 Kudos

We want to add database indexes on LP tables. What is the right way of doing it via items.xml. If we are adding the index via Database directly with every system update the indexes are getting dropped.

We've to run the db level indexes with every release when we run System Update which consumes lot of time.

Any good solution? Is there a way we can tell Hybris to not remove manually added index?

Something like this is what we want:

CREATE  INDEX custom_idx ON PRODUCTSLP (LANGPK ASC, P_NAME ASC, ITEMPK ASC);

Accepted Solutions (0)

Answers (3)

Answers (3)

pratik_a_soni
Participant
0 Kudos

As a work around. We are going to run system update by setting below property.

bootstrap.init.type.system.ignore.indices=true

So that indexes won't be dropped and then later we will turn it back false and run schema difference to run new index creation.


We will experiment this to see the feasibility. Provided we've very less new index creation.

StefanKruk
Active Participant
0 Kudos

Hi,

the right way is to add the Index to the items.xml as you already suggested. If you mark the Index as unique it will be added as a unique index where one value combination can only be added once to the table.

Also if you overwrite existing Indexes in your items.xml which were unique before, make sure that it is marked as unique again in your items.xml. If you do not do this the old unique index is still used as unique index instead of your redefined index.

pratik_a_soni
Participant
0 Kudos

hi Stefan, there is no direct way to add index for LP tables. Your build or system update will fail if you try to refer two different tables in your index defined in items.xml.


Also, there is no way I can refer LANGPK in items.xml index.

Do you've any working examples related to LP tables. Those will be helpful.

Thanks

StefanKruk
Active Participant
0 Kudos

I do not have an example right now sorry for that.

But did you try to add an index on the localized Field and the pk as Index?

As the localized Field is in the LP Table the Index I would assume that the Index would be created at the LP Table as well.

pratik_a_soni
Participant
0 Kudos

I forgot to update it earlier. But that won't work.

Sriram2009
Active Contributor
0 Kudos

Hi Soni.

Is it HANA db? if it is yes then you have to contact SAP further support and assistance.

Regards

SS

pratik_a_soni
Participant
0 Kudos

Doesn't matter which database we use, though we are using Oracle DB. The instruction to drop the index is submitted from Hybris fromework.