+const char *ap_get_database(MYSQL_THD thd) +{ + if (!thd) + return ""; + + return thd->db; +} I think this should be benchmarked with perf. Things like this ain't good
Hi Alexey, Just soem thought from my side... performance wise (we already fixed a bunch of those). That is when function call convention is more expensive than payload. Especially if you call this many times per query. Check for thd != NULL is not performance wise either (because payload is really small). I believe that thd must be set in all cases: auditing something that doesn't have context sounds a bit strange.
+ uint audit_event_code; + const void *audit_event_data; Why? Just to avoid passing this as an argument? Though these are normally just 12 bytes, (FWICS) you only need them for a very short duration. All other time it's just waste of memory. It's not a problem alone, but THD is already way too overloaded by things like this. This point was originally risen by Vicentiu back in Amsterdam.
In a nutshell, performance wise it is best if there's just one function call per event. Regards, Sergey On Sun, Oct 23, 2016 at 01:16:07PM +0400, Alexey Botchkov wrote:
Hi, Sergei.
I'd like to draw your attention to this old issue: https://jira.mariadb.org/browse/MDEV-7389
The idea was to make a bigger thing - to modify the plugin API so it is easier to use and let user to do more. Particularly to notify warnings to the audit plugins for this 7389 task. That was done with this task: https://jira.mariadb.org/browse/MDEV-5313
Just to refresh our memory: I proposed to get rid off the API versions and version-dependent memory structures that are used to transfer data to and from the plugin. All we need to do is adding new 'audit_plugin_service'. Which is just the normal service that offer methods to the auditing plugin to send commands to the server and get the server data. You can look at the patch http://lists.askmonty.org/pipermail/commits/2016-February/009025.html
So, Serg, do you have anything to say on that subject?
Best regards. HF
_______________________________________________ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp