Skip to content
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

Fix duplicate selection of books. #6

Open
bmschmidt opened this issue Jan 23, 2014 · 0 comments
Open

Fix duplicate selection of books. #6

bmschmidt opened this issue Jan 23, 2014 · 0 comments
Labels

Comments

@bmschmidt
Copy link
Member

Unconfirmed: but it seems that in the case of multi-field queries, some books may be being duplicated; so if you're searching for EITHER "whaling" or "fiction" in subject, say, Moby Dick's word count might be counted once for whaling AND once for fiction, which is obviously extremely bad behavior.

The fix is actually somewhat difficult; probably the way to do it is with a materialized table operating on an "IN" query rather than a join, which:

  1. Is only possible on MySQL 5.6 or later, I believe, with an automatically derived index on the materialized table, which is the only way this will be fast.
  2. Will slow down, probably only a little, any queries involving it since the index needs to be built anew. Depending on the speed effect, it might be worth only applying this to queries that use non-unique metadata items.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant