Code Monkey home page Code Monkey logo

fieldtop's Introduction

Intro

Fieldtop looks at all fields in all tables and all databases and analyzes how close the values in each field are to the maximum (or minimum) allowed value for the given field type. This can give you interesting insight into your databases. A typical output looks like this:

Field Min Max
community.users.id 30%
community.users.name 100%
community.users.karma 60% 1%
community.posts.id 1%
community.posts.text 100%

This would tell you a couple of things at a glance:

  • Your user IDs use 30% of the available range. Depending on how long the project has been running, this can be ok or could mean your field is in danger of overflowing at some point.
  • Some user names already use the maximum length. This is probably ok if your database design is in sync with your application.
  • The negative values in the user karma column are already pretty big. Maybe you did not expect that people aquire negative karma so fast?
  • The IDs for posts are far from the limit
  • The text field for the posts is already maxing out the max lenght. Maybe that is not what you want.

The output can be escpecially interesting for databases that have been used for extended periods of time. Often at some point, some of the data will outgrow the designated data types.

In fact, the the idea to make this tool came up when no-gravity noticed that after 10 years of unsupervised learning, his music recommendation system Gnoosic maxed out over 50% of the available range for band popularity. The popularity was stored in a signed integer which can hold numbers up to 2 billion. And Pink Floyd was already at 1.3 billion. So the popularity field was destined to overflow at some point in the future.

Testing

FieldTop has been developed and tested using MySQL 5.5.49 and PHP 5.5.9 and is expected to work on PHP >= 5.5.9

Contributing

You are welcome to send pull requests with enhancements or fixes to this project.

Bugs

Please report any bugs in the issue tracker.

fieldtop's People

Contributors

julienbalas avatar

Watchers

 avatar James Cloos 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.