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

Optimize node access query building. #3775

Closed
klonos opened this issue May 13, 2019 · 11 comments · Fixed by backdrop/backdrop#2651
Closed

Optimize node access query building. #3775

klonos opened this issue May 13, 2019 · 11 comments · Fixed by backdrop/backdrop#2651

Comments

@klonos
Copy link
Member

klonos commented May 13, 2019

This is the equivalent for https://www.drupal.org/project/drupal/issues/106721 (D7 core), which adds a node_add_node_grants_to_query() helper function. It is currently RTBC, and is blocking https://www.drupal.org/node/2204257 (Views 7.x). I came across it while working on the Views crossports in #3720.

Problem/Motivation
Drupal's current method of determining whether a specified user has access to a node is reported to have significant performance issues on a site using node access with a large number of grants.

Proposed resolution
A patch has been prepared, however it appears to be unclear as to what functionality/performance testing might be required or how it would be undertaken.

Remaining tasks
(todo) commit patch #133


PR: backdrop/backdrop#2651 (patch #133)

@klonos
Copy link
Member Author

klonos commented May 13, 2019

We have recently moved certain bits around (from node.module to node.entity.inc) with #3011, but other than that, the PR that's up for review is 1-1 with https://www.drupal.org/files/issues/drupal-106721-optimize_node_access_queries-133.patch, which is RTBC.

@klonos
Copy link
Member Author

klonos commented May 13, 2019

...I have included https://git.drupalcode.org/project/views/commit/d649d329eb2fc56d9feb1320c173fd69f3c9a986, which is part of #3720, but requires the newly-introduced node_add_node_grants_to_query() function from https://www.drupal.org/project/drupal/issues/106721

@jenlampton jenlampton changed the title [Performance] Optimize node access query building [PS] Optimize node access query building May 14, 2019
@jenlampton
Copy link
Member

jenlampton commented Sep 21, 2019

Neither of these changes have been committed to Views or Drupal core yet. But when they are, we'll want to include the similar change to views in this PR.

d649d329 | Issue #2204257 by ezra-g, andyg5000: Update Views Content access filter per core performance improvements backdrop/backdrop#2651

I have marked the views commit N/A in that views cross-port issue so we can handle it here instead.

@laryn
Copy link
Contributor

laryn commented Mar 25, 2024

This was committed to Drupal core a few years back at this point, so we should add it here.

Reference: https://www.drupal.org/project/drupal/issues/106721#comment-14117679

@klonos Do you want to revise your PR?

@klonos
Copy link
Member Author

klonos commented Apr 24, 2024

Thanks @laryn ...I'll have a look.

@klonos klonos self-assigned this Apr 24, 2024
@klonos
Copy link
Member Author

klonos commented Apr 24, 2024

...there was nothing to do (thanks for rebasing @laryn 🙏🏼 ). All tests are passing, with the exception of some CSpell nags (which we can handle separately in #6302).

@klonos
Copy link
Member Author

klonos commented Apr 25, 2024

...with the exception of some CSpell nags (which we can handle separately in #6302).

Which now has a fresh PR 😉

@laryn
Copy link
Contributor

laryn commented Nov 22, 2024

I've rebased again, all tests passing (except a cspell nag on the word multipass). I'm going to tag into 1.30 milestone for now but it could be considered for 1.29.x I think.

@quicksketch
Copy link
Member

This looks great! There's a small issue with the docblock but otherwise this would be great to get in: https://github.com/backdrop/backdrop/pull/2651/files#r1885817284

@herbdool
Copy link

LGTM

backdrop-ci referenced this issue in backdrop/backdrop Dec 30, 2024
By @klonos, @laryn, @jenlampton, @quicksketch, and @herbdool.

Port of Drupal issue #106721 by msonnabaum, hefox, lotyrin, erikwebb, catch, RenatoG, joelpittet, jrglasgow, sheldonkreger, bdragon, dawehner, oleg.medvedev, ezra-g, q0rban.
@quicksketch
Copy link
Member

Thanks for fixing that up @herbdool! I merged backdrop/backdrop#2651 into 1.x for 1.30.0 after adding a @since 1.30.0 line to the new function docblock.

backdrop/backdrop@4400676 by @klonos, @laryn, @jenlampton, @quicksketch, and @herbdool.

Port of Drupal issue #106721 by msonnabaum, hefox, lotyrin, erikwebb, catch, RenatoG, joelpittet, jrglasgow, sheldonkreger, bdragon, dawehner, oleg.medvedev, ezra-g, q0rban.

Thank you everyone!

@jenlampton jenlampton changed the title [PS] Optimize node access query building Optimize node access query building. Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants