You are viewing limited content. For full access, please sign in.

Question

Question

laserfiche search takes too long for particular field values

asked on November 7, 2018

We have a very often used advanced search that goes against our repository that looks like this:

{[LoanDocument]:[Loan ID]="88-188915A", [Loan Document Type]="4506-T - Signed"}

Using the Search Pane in the Laserfiche client (9.1.1 Service Pack 1 (9.1.1.566)), this search is taking 60 to 120 seconds and sometimes longer to return. The particular query above returns exactly one document. 

I can perform this search the exact same way but changing it to:

{[LoanDocument]:[Loan ID]="88-188915A", [Loan Document Type]="92900-A/Case Number Validation - Signed"}

This second search takes around 10 seconds to perform and returns no hits.

Changing again to:

{[LoanDocument]:[Loan ID]="88-188915A", [Loan Document Type]="Bank Statement/VOD"}

This third search takes less than a second to perform and returns 7 documents.

 

How can there be such a large descrepancy on what are essentially three identical searches accross our LoanDocument template? The first search is absolutely killing us in our Production environment at the moment. Any hints or clues would be greatly appreciated. Thanks.

Ian T. Caiozzi

Pulte Mortgage

 

 

0 0

Replies

replied on November 9, 2018

Hey, Laserfiche,

Tuesday and Wednesday this week were rough ones with the search issue I had posted here. However, our DBA Ryan was able to find the query Laserfiche is performing in the database and do some magic. I thought I'd post his solution here for you in case someone in need down the line comes up against the same kind of search problem. Note that for us, these index changes caused any given query to consistently return results in sub 0 seconds, dropping average CPU time from 45% to 4% and caused all latch waits to disappear. We had many queries that were taking over 100 seconds prior to these changes. Our searches are performing better than ever with these updates. Please keep in mind that our propval table has 430 million rows.

 

Ryan found that our specifically troublesome LF search queries run something like this:

select distinct t.tocid, t.parentid, t.linkto

from toc t

where t.tocid <> 2

and (((exists (

       select *

       from propval pv

       where pv.tocid=t.tocid

       and pv.prop_id=15

       and ((pv.short_str_val = N'shortstrval')))))

       and ((exists (

              select *

              from propval pv

              where pv.tocid=t.tocid

              and pv.prop_id=13

              and ((pv.short_str_val = N'shortstrval2'))))))

              and (t.toc_flags & 2048) = 0

 

The SQL query plan for that query looked something like this where it was seeking an index that was not optimum for the ~430million records in the propval table:

Ryan dropped the stock LF index and recreated it with a better density order and then created a new index to optimize the two subqueries:

USE [Laserfiche DB]

GO

 

DROP INDEX [propval_short_str_val_ix] ON [dbo].[propval]

GO

 

CREATE NONCLUSTERED INDEX [propval_short_str_val_ix] ON [dbo].[propval]

(

       [tocid] ASC,

       [prop_id] ASC,

       [short_str_val] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

GO

 

CREATE NONCLUSTERED INDEX [propval_IXNC02] ON [dbo].[propval]

(

       [prop_id] ASC,

       [short_str_val] ASC

)

INCLUDE ([tocid]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

GO

 

This resulted in a new query plan:

 

I realize we now have a non-standard index as part of our Laserfiche database. Please advise if anyone sees any issues with this. 

 

Ian T. Caiozzi

Pulte Mortgage, LLC 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.