bpanda
24th June 2015, 11:59
Hello All,

How does Baan filter option works on all sessions.

If query.extend.where() or query.extension are used in all cases?

I have a customized session which is based on whinh225.
I have to display the records of whinh225, but there is a filter.
I need to check another table from there based on one field condition (xx1) I'll get all the key fields of whinnh225 and show those records on the session.

Below is my code, which is working but very slow if records are more that 1-2 lakhs.

Please check this & suggest me if this query can be optimized to perform faster.

qury.str = " exists (select whxxx133._index1" &
" from whxxx133" &
" where whxxx133._index5 = {:xx1,:whinh225.oorg,:whinh225.orno,:whinh225.oset," &
" :whinh225.pono,:whinh225.seqn,:whinh225.sern})"
query.extend.where(qury.str)


Thanks & Regards
Biswajyoti Panda

mark_h
25th June 2015, 15:24
Not really familiar with this but do you really need the exists? Couldn't you just extend it to where it is equal to those records. You can search this forum to find other examples of query.extend.where. Just a shot in the dark here.

bpanda
26th June 2015, 08:41
Hello,
I got this solved, it's now fast as expected.

With same code

Only thing I did, just removed the duplicate indices from the table whxxx133

Due to duplicate index the table was performing very slow.

Thanks & Regards
Biswajyoti Panda

benito
26th June 2015, 16:33
i don't think creating duplicate indices is a good practice anyway. i do that if it's absolutely necessary.

mark_h
26th June 2015, 19:23
Why would you need them? Just curious.

benito
26th June 2015, 21:38
mark i have to search for what i did because it's been a long time. in my case i just needed more granularity in the query. so for example if the available index is orno,pono then i create another dupl index called orno, pono,seqn. note that all it needs is for 2 consecutive fields to be in the same order as the first to be considered Duplicate. the other reason is the sorting of view in the multi-occurrence dynamic form. as i said i try to avoid this as much as i can.

mark_h
26th June 2015, 22:57
Ahhh - now I understand what you mean by duplicate. I was thinking two identical indexes with the exact same fields - not just two consecutive fields. Now I get it - thanks.