Giter VIP home page Giter VIP logo

rt-extension-mysqlqueryhints's Introduction

MySQL Query Hint Extension for RequestTracker

Table of Contents

  1. About
  2. License
  3. Support
  4. Requirements
  5. Installation
  6. Configuration

About

This plugin adds optimizer hints to every sql query:

Resource Groups

Resource groups can be used to manage workloads on mysql servers. Each query can utilize a specific number of CPU or have different thread priority. The plugin add the executing RT user to the query. You can restrict resources for users and log which user is executing queriey (searches) on the system

Execution Time

Adds MAX_EXECUTION_TIME to the query without global or user based configuration on the sql server.

Example: Slow Query Log

# mysqldumpslow -t 10

Count: 3  Time=0.00s (0s)  Lock=0.00s (0s)  Rows_sent=1.0 (3), Rows_examined=1.0 (3), rt_user[rt_user]@localhost
  SELECT /*+ MAX_EXECUTION_TIME(N) */ /*+ RESOURCE_GROUP(RT_User_14322) */ * FROM Tickets WHERE id = 'S' FOR UPDATE
  
Count: 35  Time=0.00s (0s)  Lock=0.00s (0s)  Rows_sent=1.9 (68), Rows_examined=1.4 (48), rt_user[rt_user]@localhost
  SELECT /*+ MAX_EXECUTION_TIME(N) */ /*+ RESOURCE_GROUP(RT_User_14322) */ main.* FROM Attributes main  WHERE
  (main.ObjectId = N) AND (main.ObjectType = 'S')  ORDER BY main.id ASC

License

This project is licensed under the terms of the GNU General Public License Version 2.

This software is Copyright (c) 2018 by NETWAYS GmbH <[email protected]>.

Support

For bugs and feature requests please head over to our issue tracker. You may also send us an email to [email protected] for general questions or to get technical support.

Requirements

  • RT 4.4.2
  • RT with MySQL database

Installation

Extract this extension to a temporary location.

Navigate into the source directory and install the extension.

perl Makefile.PL
make
make install

Clear your mason cache.

rm -rf /opt/rt4/var/mason_data/obj

Restart your web server.

systemctl restart httpd

systemctl restart apache2

Configuration

$QueryHint_Group_Disable

Resource groups are enabled per default. Set this to '1' to disable resource groups.

$QueryHint_Group_Prefix

Prefix of the resource group. Default is RT_User_.

$QueryHint_Group_Default

If the query is not user initiated (cli, while login), this resource group is added. Default is RT_User_Default

$QueryHint_Group_Use_User_Id

Per default the user name is added to group prefix. Set this to '1' to add user id's instead.

$QueryHint_Max_Execution_Time

Add MAX_EXECUTION_TIME(milliseconds) optimizer hint. Value must be integer and represents milliseconds.

Example

Plugin('RT::Extension::MySQLQueryHints');
Set($QueryHint_Group_UID, 1);
Set($QueryHint_Max_Execution_Time, 1500);

rt-extension-mysqlqueryhints's People

Contributors

martialblog avatar mistermountain avatar mxhash avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.