index_hunter's People
index_hunter's Issues
Scout integration to retrieve sql logs
Retrieve sql logs on server and analyse query usage in order to adapt strategy
Make a better algorithm to optimize indexes
IndexOptimiser
find_covering_indexes
could be better
- So far the logic of the index_optimiser is pretty simple :
- take columns in the queries with most columns criteria, sort them by cardinality, create indexes for them.
- check if these indexes covers the other queries
- if not create index for these other queries
Make a better Regex in query_finder to collect queries in project
QueryFinder
Make better regex to match queries
- only handling active record
- doesnt work for chained method when result of query is put into variable
Ex :transactions = MerchantTransaction.where(status: 1)
transactions.where(kind: 'BATCH_BET')
is not caught by regex replace_variables_in_query_string
could be maybe improved with a config_file and a parser that automatically replaces variables
Retrieve sql and fields from direct active record db call (find_by, find...)
QueriesDeconstructor
retrieve_query_fields
could be better
Right now, to retrieve the column criterias from the queries. I instantiate them as lambdas then call where_values_hash
on them.
This method gives info about the query, which is cool.
Hwver where_values_hash only works for active_record method that dont directly call the db ==> not working with all of those :
ACTIVE_RECORD_NOT_SQLABLE = ['find', 'find_by', 'find_by!', 'find_by_sql', 'pluck', 'take', 'exists?', 'any?', 'many?', 'count', 'minimum', 'maximum', 'sum']
I do a dirty hack by transforming temporarily a .find_by into a .where. WE CAN DO BETTER
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.