Skip to content

issue #418 - add order by clause to searchByIds to ensure sorted results#419

Merged
lmsurpre merged 1 commit intomasterfrom
issue-410
Nov 15, 2019
Merged

issue #418 - add order by clause to searchByIds to ensure sorted results#419
lmsurpre merged 1 commit intomasterfrom
issue-410

Conversation

@lmsurpre
Copy link
Copy Markdown
Member

  1. Updated the SearchPerformanceTest so that the observations have
    components with values...just to easily create many observations which
    helps verify the search behavior. This change could be removed if we
    want.

  2. Deleted unused variants of searchForIds and searchByIds. I think
    these came from the original "basic" schema that was removed for
    Remove all references to the "basic" schema #93 but they were no longer in use and
    should be safe to delete.

  3. Introduced ORDER BY CASE clause to ResourceDAOImpl.searchByIds.
    I found that DERBY is always returning the results in the same order as
    the resource ids provided in the "IN" clause, but in general we
    shouldn't rely on that. I tested the CASE statements on derby with up
    to 1000 results, but we need to run a similar test on Db2 to ensure it
    works there as well.

Signed-off-by: Lee Surprenant lmsurpre@us.ibm.com

1. Updated the SearchPerformanceTest so that the observations have
components with values...just to easily create many observations which
helps verify the search behavior.  This change could be removed if we
want.

2. Deleted unused variants of searchForIds and searchByIds. I think
these came from the original "basic" schema that was removed for
#93 but they were no longer in use and
should be safe to delete.

3. Introduced ORDER BY CASE clause to ResourceDAOImpl.searchByIds.
I found that DERBY is always returning the results in the same order as
the resource ids provided in the "IN" clause, but in general we
shouldn't rely on that.  I tested the CASE statements on derby with up
to 1000 results, but we need to run a similar test on Db2 to ensure it
works there as well.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
Copy link
Copy Markdown
Contributor

@albertwang-ibm albertwang-ibm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, simple and easy, I like this!

@albertwang-ibm
Copy link
Copy Markdown
Contributor

still a lit bit surprised to see that we search and find the ids first and then search those ids to get the results, just curious, why don't we get the full results in the first search.

@lmsurpre
Copy link
Copy Markdown
Member Author

@JohnTimm can you address Albert's comment? Pretty sure it was like this before I got in here, but not sure on the reasoning. Does it help to leave out the Data blob column while doing the filtering?

@lmsurpre lmsurpre merged commit 38d5647 into master Nov 15, 2019
@lmsurpre lmsurpre deleted the issue-410 branch November 15, 2019 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants