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 DataItemHandler::getIndexHint, refs 3142 #3261

Merged
merged 1 commit into from Jul 28, 2018

Conversation

Projects
None yet
2 participants
@mwjames
Copy link
Contributor

mwjames commented Jul 28, 2018

This PR is made in reference to: #3142

This PR addresses or contains:

  • Provide a index hint on those queries that showed an irregular behaviour due to the query planner to choose an sup-optimal query.

This PR includes:

  • Tests (unit/integration)
  • CI build passed

Example

// SELECT smw_id, smw_title, smw_namespace, smw_iw, smw_subobject, smw_sortkey, smw_sort
// FROM `smw_object_ids`
// INNER JOIN `smw_di_blob` AS t1 FORCE INDEX(s_id) ON t1.s_id=smw_id
// WHERE t1.p_id='310174' AND smw_iw!=':smw'
// AND smw_iw!=':smw-delete' AND smw_iw!=':smw-redi'
// GROUP BY smw_sort, smw_id LIMIT 26
//
// 137.4161ms SMWSQLStore3Readers::getPropertySubjects
//
// vs.
//
// SELECT smw_id, smw_title, smw_namespace, smw_iw, smw_subobject, smw_sortkey, smw_sort
// FROM `smw_object_ids`
// INNER JOIN `smw_di_blob` AS t1 ON t1.s_id=smw_id
// WHERE t1.p_id='310174' AND smw_iw!=':smw' AND smw_iw!=':smw-delete'
// AND smw_iw!=':smw-redi'
// GROUP BY smw_sort, smw_id LIMIT 26
//
// 23482.1451ms SMWSQLStore3Readers::getPropertySubjects
// SELECT smw_id, smw_title, smw_namespace, smw_iw, smw_subobject, smw_sortkey, smw_sort
// FROM `smw_object_ids` INNER JOIN `smw_di_number` AS t1 FORCE INDEX(s_id) ON t1.s_id=smw_id
// WHERE t1.p_id='310194' AND smw_iw!=':smw' AND smw_iw!=':smw-delete' AND smw_iw!=':smw-redi'
// GROUP BY smw_sort, smw_id
// LIMIT 26
//
// 584.9450ms SMWSQLStore3Readers::getPropertySubjects
//
// vs.
//
// SELECT smw_id, smw_title, smw_namespace, smw_iw, smw_subobject, smw_sortkey, smw_sort
// FROM `smw_object_ids`
// INNER JOIN `smw_di_number` AS t1 ON t1.s_id=smw_id
// WHERE t1.p_id='310194' AND smw_iw!=':smw' AND smw_iw!=':smw-delete' AND smw_iw!=':smw-redi'
// GROUP BY smw_sort, smw_id
// LIMIT 26
//
// 21448.2622ms	SMWSQLStore3Readers::getPropertySubjects

@mwjames mwjames added the performance label Jul 28, 2018

@mwjames mwjames added this to the SMW 3.0.0 milestone Jul 28, 2018

@mwjames

This comment has been minimized.

Copy link
Contributor

mwjames commented Jul 28, 2018

@kghbln FYI Let me know if we see any unusual behaviour after this have been deployed to the sandbox.

@mwjames mwjames merged commit 1c4d6b4 into master Jul 28, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@mwjames mwjames deleted the force-index branch Jul 28, 2018

@kghbln

This comment has been minimized.

Copy link
Member

kghbln commented Jul 28, 2018

Looks like a great improvement! Just deployed to sandbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment