zoukankan      html  css  js  c++  java
  • UNSIGNED commandline client

    High Performance MySQL, Third Edition
    by Baron Schwartz, Peter Zaitsev, and Vadim Tkachenko
     

    There are two kinds of numbers: whole numbers and real numbers (numbers with afractional part). If you’re storing whole numbers, use one of the integer types: TINYINT, SMALLINT,  MEDIUMINT, INT, or BIGINT. These require 8, 16, 24, 32, and 64 bits of storage space, respectively. They can store values from −2(N–1) to 2(N–1)–1, where N is the numberof bits of storage space they use.

    Integer types can optionally have the UNSIGNED attribute, which disallows negative values and approximately doubles the upper limit of positive values you can store. For example, a TINYINT UNSIGNED can store values ranging from 0 to 255 instead of from−128 to 127.

    Signed and unsigned types use the same amount of storage space and have the same performance, so use whatever’s best for your data range.Your choice determines how MySQL stores the data, in memory and on disk. However, integer computations generally use 64-bit BIGINT integers, even on 32-bit architectures.(The exceptions are some aggregate functions, which use DECIMAL or DOUBLE to performcomputations.).

    MySQL lets you specify a “width” for integer types, such as INT(11). This is meaningless for most applications: it does not restrict the legal range of values, but simply specifiesthe number of characters MySQL’s interactive tools (such as the command-line client) will reserve for display purposes. For storage and computational purposes, INT(1) isidentical to INT(20).

  • 相关阅读:
    和Java相关的书籍,想成为架构师的请收藏一下啊
    CF1404C Fixed Point Removal 题解
    Harbour.Space Scholarship Contest 2021-2022 (open for everyone, rated, Div. 1 + Div. 2) E~G 题解
    ABC223G Vertex Deletion 题解
    ARC103D Distance Sums 题解
    ARC103B Robot Arms 题解
    ABC221G Jumping sequence 题解
    ABC221F Diameter set 题解
    ABC211H Count Multiset 题解
    CF1342E Placing Rooks 题解
  • 原文地址:https://www.cnblogs.com/rsapaper/p/5838434.html
Copyright © 2011-2022 走看看