Hi, would you expect that there were a performance...
# suitescript
w
Hi, would you expect that there were a performance difference in running a search with a filter like this?:
new nlobjSearchFilter('internalid', 'custcol_related_record', 'anyof', ['1234','...','...'])
compared to:
new nlobjSearchFilter('custcol_related_record', null, 'anyof', ['1234','...','...'])
It is a transaction search on invoice-rows and there are over 25 million lines (including head/tax/etc) The join is to a custom record with over 15 million records. Which one would you expect to be faster?
b
i would normally say
new nlobjSearchFilter('custcol_related_record', null, 'anyof', ['1234','...','...'])
, the way you present it means i guess
new nlobjSearchFilter('internalid', 'custcol_related_record', 'anyof', ['1234','...','...'])
w
haha, I thought I was sneaky... 🙂 Yes, in this case
new nlobjSearchFilter('internalid', 'custcol_related_record', 'anyof', ['1234','...','...'])
works, while the other one times out/takes around 3-4 minutes in a scheduled script.
We are having some database issues since the upgrade this weekend though. Slowness overall on searches and such.
I wonder what the difference would be on the back-end.
b
my guess here is that internalid is indexed, custcol_related_record is not
w
hmm, I see.
Makes sense actually.
b
keep in mind that i would ignore a lot of what i say about databases
i know very little about maintaining them
w
haha ok. But it does sound pretty logical. In the transaction table, the field custcol_related_record which would hold the internalid is not indexed. But the sames value is indexed in the custrecord_related_record-table.
p
When you look at the schema that is presented over ODBC, it suggests there’s a foreign key between the custom record ID and any referencing table. That (to me) suggests that it is indexed, as unindexed foreign keys are baaaad. Though that’s assuming that what we see over ODBC is the physical structure and not just some logical representation (which I suspect it is, due to how fine grained the permissions can be on said data)
👍 1
Sorry, that doesn’t really help, just a brain dump :)