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

Store session info in db variables instead of in temp table #811

Merged
merged 13 commits into from
Oct 17, 2019

Conversation

mattmundell
Copy link
Contributor

@mattmundell mattmundell commented Oct 16, 2019

This avoids the CREATE TEMP TABLE that is run at the beginning of every GMP
session, by instead storing the info in Postgres session variables.

These CREATE TEMP TABLEs were about 10% of the total SQL time on my example
report. With this PR these statements no longer appear in the pg_stats summary,
but it is hard to see if the total time improved. Sometimes it is a low as 390ms
but sometimes it is 450ms as before.

I thought perhaps the total time was not consistently lower because of accessing
the session vars in the result iterator columns and SQL functions. So I've
added commits which move these accesses out into the opts "table". This
does not seem to improve the situation, but I'm leaving them in here
because they're a start towards not needing the session variables at all. That's
good because: 1 It will save us a percent or two not having to set them up, 2 the
SQL functions will be simpler (and maaaybe some will be faster).

Checklist:

@mattmundell mattmundell marked this pull request as ready for review October 17, 2019 10:33
@mattmundell mattmundell merged commit 1485ff5 into greenbone:master Oct 17, 2019
@mattmundell mattmundell deleted the current-credentials branch October 17, 2019 14:50
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