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

RedirectRowAction to new window causes duplicate full query #150

Open
HawtDogFlvrWtr opened this issue Oct 18, 2023 · 0 comments
Open

RedirectRowAction to new window causes duplicate full query #150

HawtDogFlvrWtr opened this issue Oct 18, 2023 · 0 comments

Comments

@HawtDogFlvrWtr
Copy link

HawtDogFlvrWtr commented Oct 18, 2023

Laravel: 10.28.0
laravel-table 5.3.1
php 8.2

When you set $openInNewWindow to true on a RedirectRowAction, it runs a full aggregate count search, and a full limit offset search to repopulate the table before redirecting. If you set $openInNewWindow to false, it just redirects properly. When you have have fast queries, this isn't an issue, but if you have pagination that takes a second or two to return due to the amount of data, it can take ages to load the original table, and just as long to redirect while it waits to run the original table generation queries again.

Set True:

new RedirectRowAction("search/show/$data->fdid", 'More Information', '<i class="fa-solid fa-circle-info fs-2"></i>', ['link-info', 'btn', 'btn-light-dark', 'btn-icon', 'btn-sm'], null, null, true),

[2023-10-18 11:40:02] local.INFO: select * from "users" where "id" = ? limit 1 [177] 
[2023-10-18 11:40:02] local.INFO: select * from "search" where "search"."fdid" = ? limit 1 ["49929"] 
[2023-10-18 11:40:02] local.INFO: select count(*) as aggregate from "search" inner join "types" on "types"."id" = "search"."type"  
[2023-10-18 11:40:02] local.INFO: select "search".*, "types"."name" as "name", "search"."md5" as "search.md5" from "search" inner join "types" on "types"."id" = "search"."file_type" order by "last_updated_on" desc limit 15 offset 0  
[2023-10-18 11:40:02] local.INFO: select * from "users" where "id" = ? limit 1 [177]

Set False:

new RedirectRowAction("search/show/$data->fdid", 'More Information', '<i class="fa-solid fa-circle-info fs-2"></i>', ['link-info', 'btn', 'btn-light-dark', 'btn-icon', 'btn-sm'], null, null, false),

[2023-10-18 11:41:14] local.INFO: select * from "users" where "id" = ? limit 1 [177] 
[2023-10-18 11:41:14] local.INFO: select * from "search" where "search"."fdid" = ? limit 1 ["49929"] 
[2023-10-18 11:41:14] local.INFO: select * from "users" where "id" = ? limit 1 [177] 
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

No branches or pull requests

1 participant