-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to index custom metadata columns, and allow message browser search to use that index #4320
Comments
@cturczynskyj @pladesma please reopen this one |
@tonygermano - Will you please provide more justification for this request? |
Jon Bartels asked me to add a comment to this issue here. I always thought (back from the time I took the Fundamentals course with NextGen) that custom meta data columns were indexed. I've been using custom meta data columns for ever, and I always noticed that they were slow to search. EVERY SINGLE CHANNEL that I have has two custom meta data columns: MRN And this is required in my case because most of the times I get questions like: . When did we receive the order for acc#? I get these requests on a daily basis, multiple times per day. Right now, some of my channels have a lot of data (and I don't want to purge them - I have them set to 90 days which is enough to do my troubleshooting). Doing a search with either acc# or MRN it takes about 10", sometimes a bit more, sometimes less. It'd be great if these columns were automatically indexed so that my search would be super quick. I'm considering adding manual indexes to the tables like this:
|
Anibal inspired me to bang out a query which generates the index statements. READ THE COMMENT AND DONT JUST BLINDLY INDEX EVERYTHING. https://gist.github.com/jonbartels/38ffbb101ea32f981cc9950a21ec6809 |
Just to provide an update on this issue. After A LOT of testing and trying things - with huge help from @pacmano1 , @siddharth, @hobbs, @jonbartels we found that just adding an index doesn't provide much help. In fact, we see that the native query in pg is extremely fast. In a table with 1.8m messages, a search by acc# indexed is sub-second. However, when you do the same in MC you're waiting 20 seconds (!!!!). What we did notice is that if we change the page size in MC's GUI to 1 then the search results come in sub-second! So, there's something here going on in MC's search that it's not showing the data to the user in a timely fashion. This might be a completely different issue that then OP in this issue, but I'll leave that up to you. For now, my workaround is the following:
To create the index for channel called "To FFI" for column "ACC_NUMBER" I do the following:
And then:
|
I think you want your index to contain message_id as well. Otherwise, it's just an INDEX on the column which still has to go to the clustered-index (or however the table is organized) for the table to get the message_id to then ... get the message. So you may as well include message_id as a part of the INDEX as well so that the index itself can answer any question you may have for it. You aren't going to do a |
Whether the message browser search actually uses the index is dependent on the search criteria. Likely it would only use the index for simple searches where the only criterion is the metadata column itself.
Imported Issue. Original Details:
Jira Issue Key: MIRTH-4445
Reporter: narupley
Created: 2019-07-15T07:52:06.000-0700
The text was updated successfully, but these errors were encountered: