Developer forum

Forum » Ecommerce - Standard features » Determine why building index is slow

Determine why building index is slow

Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi,

 

I need some help/pointers so that I can investigate why an index of less than 40k products (log attached) with a very basic IndexBuilderExtender (code also attached) would take 10min to run.

 

Any pointers?

 

Best Regards,

Nuno Aguiar

 


Replies

 
Nicolai Pedersen
Reply

Cannot see what happens in your helper - but it looks innocent. Try to remove the extender and see.

How many field do you index? How many do you store?

BR Nicolai

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

  • I removed the dll as suggested and I don't think there's another one at play (hence the thread https://doc.dynamicweb.com/forum/feature-requests?ThreadID=70339)
  • We're using the Product Schema Extender
    • But we're planning to convert to individual fields - if nothing else to be able to work with Query which is painfully slow (we talked about it on another thread)
  • We're using (far too many) fields for free text search
    • We're in the process of reducing it - in "negociations" with customer
    • We're going to create 4 summary fields - merge the ones with the same boost value
  • I am attaching the index we're using

 

I've worked with larger indexes and did not experience it. Maybe it's something in the data? But what? Any other ideas on how I can track this down?

 

Best Regards,

Nuno Aguiar

 
Nicolai Pedersen
Reply

You can always attach a profiler during the indexing - see what methods it is.

It could simply be that you have many fields that is stored - causing a lot of IO and hence degration in performance.

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

>> You can always attach a profiler during the indexing - see what methods it is.

D'uh!!! Yes of course. I'll do that.

 

I'll let you know what I can find, especially if it's something we can improve in DW to make it better.

 

Best Regards,

Nuno Aguiar

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

This is still puzzling. A code profiler pointed to the index only (did not go through in detail), but we decided to look into a SQL Profiler and we found some interesting thing that need your help with.

https://www.screencast.com/t/jzc3VwWWL3by

  • Every 500 batch of records is taking 7 to 10 secs to respond from SQL
    (the math adds up, being the response time from SQL that causes it to take 9-10min to rebuild the indexes)
  • But when we request it directly it's immediate
    You can see me doing it through a dummy template, but in SSMS it's also immediate

 

I tried looking into the code for indexing, but I don't feel I know enough to get a clue.

 

Do you know of any reason why we'd be seeing this amount of time when requesting it through the Repository?

 

Best Regards,

Nuno Aguiar

 

Thoughts?

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply
This post has been marked as an answer

Hi Nuno,

I don't think the slowness is due to the SQL. Rather, I think that it's because of the amount of data that the builder needs to process. Since we don't release the DataReader until the records have been processed, you'll see it as a long-running query in SQL Profiler.

My recommendation would be to take a look at your builder settings and turn off unnecessary processing or minimizing the number of fields in order to bring the build time down. For example, you should turn on "SkipGroupSorting" and "SkipImages".

If this doesn't help, you may need to add a code profiler to see where the time goes. Alternatively, we would need a copy of the solution to investigate the issue.

- Jeppe

Votes for this answer: 1
 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Jeppe,

 

Thanks, I found out the issue, although I don't know if there's a solution for it. Maybe there's some optimization we can do in DW? I'll let you be the judge of that.

  • SkipPrices was the problem - turning it off goes from 10 min to a little over 1
  • I then looked into the code and setup
    • We had 4 currencies set up (Rapido data) - we stripped it down to 1
    • We have all countries - because the customer can ship everywhere
    • The HandlePrices method seems to be the culprit
  • We don't really need prices per country/curreny indexed, so I can live with that

 

Best Regards,

Nuno Aguiar

 

You must be logged in to post in the forum