精华内容
下载资源
问答
  • Google Optimize的事件监听器 修改版 使开发人员可以等到Optimize加载后再运行某些代码。 当Optimize加载缓慢(例如,如果通过GTM加载)且站点js依赖于实验中所做的更改时(在我们的用例中,我们需要等到进行API...
  • OPTIMIZE TABLE

    2020-12-12 11:16:51
    13.7.2.4 OPTIMIZE TABLE Syntax OPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE tbl_name [, tbl_name] ... OPTIMIZE TABLE reorganizes the physical storage of table data and associated index data,

    https://dev.mysql.com/doc/refman/5.7/en/optimize-table.html

    13.7.2.4 OPTIMIZE TABLE Syntax

    OPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE tbl_name [, tbl_name] ...

    OPTIMIZE TABLE reorganizes the physical storage of table data and associated index data, to reduce
    storage space and improve I/O efficiency when accessing the table. The exact changes made to each
    table depend on the storage engine used by that table.

    优化表重新组织表数据和相关索引数据的物理存储,以减少存储空间和提高访问表时的I/O效率。对每一个表依赖于该表使用的存储引擎。

    Use OPTIMIZE TABLE in these cases, depending on the type of table:

    在这些情况下,请根据表的类型使用OPTIMIZE TABLE:

    After doing substantial insert, update, or delete operations on an InnoDB table that has its own
    .ibd file because it was created with the innodb_file_per_table option enabled. The table and
    indexes are reorganized, and disk space can be reclaimed for use by the operating system

    在对一个拥有自己的InnoDB表执行大量的insert、update或delete操作之后.ibd文件,因为它是在启用innodb_file_per_table选项的情况下创建的。table和

    索引被重新组织,磁盘空间可以被回收以供操作系统使用.

    After doing substantial insert, update, or delete operations on columns that
    are part of a FULLTEXT index in an InnoDB table. Set the configuration option
    innodb_optimize_fulltext_only=1 first. To keep the index maintenance period to a
    reasonable time, set the innodb_ft_num_word_optimize option to specify how many words to
    update in the search index, and run a sequence of OPTIMIZE TABLE statements until the search
    index is fully updated.

    在对要执行以下操作的列进行大量的插入,更新或删除操作之后是InnoDB表中FULLTEXT索引的一部分。 设置配置选项
    首先是innodb_optimize_fulltext_only = 1。 使索引维护期保持在在合理的时间,设置innodb_ft_num_word_optimize选项以指定要输入的单词数
    更新搜索索引,并运行一系列OPTIMIZE TABLE语句,直到进行搜索索引已完全更新。

    After deleting a large part of a MyISAM or ARCHIVE table, or making many changes to a MyISAM or
    ARCHIVE table with variable-length rows (tables that have VARCHAR, VARBINARY, BLOB, or TEXT
    columns). Deleted rows are maintained in a linked list and subsequent INSERT operations reuse
    old row positions. You can use OPTIMIZE TABLE to reclaim the unused space and to defragment
    the data file. After extensive changes to a table, this statement may also improve performance of
    statements that use the table, sometimes significantly.

    删除MyISAM或ARCHIVE表的很大一部分,或对MyISAM或
    具有可变长度行的ARCHIVE表(具有VARCHAR,VARBINARY,BLOB或TEXT的表
    列)。 删除的行将保留在链接列表中,并且后续的INSERT操作可重复使用
    旧行位置。 您可以使用OPTIMIZE TABLE回收未使用的空间并进行碎片整理
    数据文件。 在对表进行大量更改之后,此语句还可以提高表的性能。
    使用该表的语句,有时很明显。

    This statement requires SELECT and INSERT privileges for the table.

     该语句需要对该表具有SELECT和INSERT权限。

    OPTIMIZE TABLE works for InnoDB, MyISAM, and ARCHIVE tables. OPTIMIZE TABLE is also supported for dynamic columns of in-memory NDB tables. It does not work for fixed-width columns of inmemory tables, nor does it work for Disk Data tables. The performance of OPTIMIZE on NDB Cluster tables can be tuned using --ndb-optimization-delay, which controls the length of time to wait between processing batches of rows by OPTIMIZE TABLE. For more information, see Previous NDB
    Cluster Issues Resolved in NDB Cluster 7.3.

    OPTIMIZE TABLE适用于InnoDB,MyISAM和ARCHIVE表。 内存NDB表的动态列也支持OPTIMIZE TABLE。 它不适用于内存表的固定宽度列,也不适用于磁盘数据表。 可以使用--ndb-optimization-delay调整NDB群集表上OPTIMIZE的性能,该参数控制通过OPTIMIZE TABLE处理批处理行之间的等待时间。 有关更多信息,请参见上一个NDB。 NDB Cluster 7.3中解决的群集问题。

    By default, OPTIMIZE TABLE does not work for tables created using any other storage engine and returns a result indicating this lack of support. You can make OPTIMIZE TABLE work for other storage
    engines by starting mysqld with the --skip-new option. In this case, OPTIMIZE TABLE is just mapped to ALTER TABLE.
    This statement does not work with views

    默认情况下,OPTIMIZE TABLE不适用于使用任何其他存储引擎创建的表,并返回指示缺少支持的结果。 您可以使OPTIMIZE TABLE用于其他存储
    通过使用--skip-new选项启动mysqld来启动引擎。 在这种情况下,OPTIMIZE TABLE仅映射到ALTER TABLE。
    该语句不适用于视图

    OPTIMIZE TABLE is supported for partitioned tables. For information about using this statement with
    partitioned tables and table partitions, see Section 22.3.4, “Maintenance of Partitions”.
    By default, the server writes OPTIMIZE TABLE statements to the binary log so that they replicate to
    replication slaves. To suppress logging, specify the optional NO_WRITE_TO_BINLOG keyword or its
    alias LOCAL.

    分区表支持OPTIMIZE TABLE。 有关在以下情况下使用此语句的信息:
    分区表和表分区,请参见第22.3.4节“分区维护”。
    默认情况下,服务器将OPTIMIZE TABLE语句写入二进制日志,以便将它们复制到
    复制从属
    。 要禁止记录日志,请指定可选的NO_WRITE_TO_BINLOG关键字或其别名LOCAL。

    OPTIMIZE TABLE Output

    OPTIMIZE TABLE returns a result set with the columns shown in the following table.

    OPTIMIZE TABLE返回具有下表所示列的结果集。

     

    OPTIMIZE TABLE table catches and throws any errors that occur while copying table statistics from
    the old file to the newly created file. For example. if the user ID of the owner of the .frm, .MYD, or
    .MYI file is different from the user ID of the mysqld process, OPTIMIZE TABLE generates a "cannot
    change ownership of the file" error unless mysqld is started by the root user.

    从表复制表统计信息时,OPTIMIZE TABLE表会捕获并引发任何错误
    旧文件到新创建的文件。 例如。 .frm,.MYD或所有者的用户ID,或者
    .MYI文件不同于mysqld进程的用户ID,OPTIMIZE TABLE生成“无法
    除非root用户启动mysqld,否则更改文件所有权”错误。

    InnoDB Details

    For InnoDB tables, OPTIMIZE TABLE is mapped to ALTER TABLE ... FORCE, which rebuilds the table to update index statistics and free unused space in the clustered index. This is displayed in the
    output of OPTIMIZE TABLE when you run it on an InnoDB table, as shown here:

    对于InnoDB表,OPTIMIZE TABLE映射到ALTER TABLE ... FORCE,这将重建表以更新索引统计信息并释放聚簇索引中未使用的空间。 这显示在
    在InnoDB表上运行OPTIMIZE TABLE的输出,如下所示:

    OPTIMIZE TABLE uses online DDL for regular and partitioned InnoDB tables, which reduces
    downtime for concurrent DML operations. The table rebuild triggered by OPTIMIZE TABLE and
    performed under the cover by ALTER TABLE ... FORCE is completed in place. An exclusive table
    lock is only taken briefly during the prepare phase and the commit phase of the operation. During the prepare phase, metadata is updated and an intermediate table is created. During the commit phase,
    table metadata changes are committed.

    OPTIMIZE TABLE对常规和分区InnoDB表使用联机DDL,这将减少并发DML操作的停机时间。Table触发重建由OPTIMIZE TABLE和ALTER TABLE ... FORCE执行

    完全覆盖到位。独占锁只在操作的准备阶段和提交阶段短暂执行。在准备阶段,更新元数据并创建中间表。在提交阶段,

    表元数据更改已提交

    OPTIMIZE TABLE rebuilds the table using the table copy method under the following conditions:

    • When the old_alter_table system variable is enabled.
    • When the mysqld --skip-new option is enabled.

    在以下情况下,OPTIMIZE TABLE使用表复制方法重建表:
    • 启用old_alter_table系统变量时。
    • 启用mysqld --skip-new选项时。

    OPTIMIZE TABLE using online DDL is not supported for InnoDB tables that contain FULLTEXT
    indexes. The table copy method is used instead.

    包含全文的InnoDB表不支持使用联机DDL优化表索引。而是使用表复制方法。

    InnoDB stores data using a page-allocation method and does not suffer from fragmentation in the
    same way that legacy storage engines (such as MyISAM) will. When considering whether or not to run
    optimize, consider the workload of transactions that your server will process:

    InnoDB使用页面分配方法存储数据,并且在与传统存储引擎(如MyISAM)一样。在考虑是否参选时优化,请考虑服务器将处理的事务的工作负载:

    • Some level of fragmentation is expected. InnoDB only fills pages 93% full, to leave room for updates without having to split pages.

    预计会有一些碎片。 InnoDB只填满93%的页面,为更新留出空间,而不必拆分页面。

    • Delete operations might leave gaps that leave pages less filled than desired, which could make it worthwhile to optimize the table.

    Delete操作可能会留下空白,使页面的填充度低于预期,这可能使优化表变得有价值。

    • Updates to rows usually rewrite the data within the same page, depending on the data type and row format, when sufficient space is available. See Section 14.9.1.5, “How Compression Works for

    InnoDB Tables” and Section 14.11, “InnoDB Row Formats”.

    当有足够的空间时,对行的更新通常会重写同一页中的数据,具体取决于数据类型和行格式。参见第14.9.1.5节,“压缩是如何工作的

    “InnoDB表”和第14.11节“InnoDB行格式”。

    •  High-concurrency workloads might leave gaps in indexes over time, as InnoDB retains multiple versions of the same data due through its MVCC mechanism. See Section 14.3, “InnoDB Multi-Versioning”.

    随着时间的推移,高并发工作负载可能会在索引中留下空白,因为InnoDB通过其MVCC机制保留了同一数据的多个版本。请参阅第14.3节“InnoDB多版本控制”。

     

    MyISAM Details

    For MyISAM tables, OPTIMIZE TABLE works as follows:
    1. If the table has deleted or split rows, repair the table.
    2. If the index pages are not sorted, sort them.
    3. If the table's statistics are not up to date (and the repair could not be accomplished by sorting the index), update them.

    对于MyISAM表,OPTIMIZE TABLE的工作方式如下:
    1.如果表已删除或拆分行,请修复该表。
    2.如果索引页未排序,请对其进行排序。
    3.如果表的统计信息不是最新的(并且无法通过对索引进行排序来修复),请对其进行更新。

     

    展开全文
  • Django-google-optimize是一个Django应用程序,旨在简化运行Google Optimize A / B测试的过程。 安装 使用pip安装django-google-optimize: pip install django-google-optimize 将应用程序添加到已安装的Django...
  • nuxt-google-optimize 适用于Nuxt.js的SSR友好型Google Optimize模块 特征 支持多种实验(AB或MVT [Multi-Variant]) 自动为用户分配实验/变体 使用Cookie的SSR支持 CSS和状态注入 自动撤销测试人员的过期实验 ...
  • 与Google Optimize集成。 文件: 使用GTAG优化部署: : 优化JS API: : 安装 yarn add react-optimize 首先,您需要添加带有优化容器ID的gtag代码段。 如果您使用的是 ,则可以将以下内容添加到public/index....
  • docker-optimize-源码

    2021-05-29 12:23:35
    docker build -f Dockerfile -t optimize/docker:1.0 . docker build -f Dockerfile-V2 -t optimize/docker:2.0 . 检查每个图像的历史记录 docker history optimize/docker:1.0 docker history optimize/docker:2.0...
  • scikit-optimize:具有`scipy.optimize`接口的基于模型的顺序优化
  • 围绕Google Optimize高度可定制,无依赖,通用的服务抽象。 google-optimize-service在周围提供了一个轻量级的抽象层。 它使您可以轻松访问和管理实验信息。 目录 得到() 钥匙() 地点() 坚持() ...
  • optimize table

    2016-09-08 18:45:00
    optimize table在优化MySQL时很重要。所以对于写比较频烦的表,要定期进行optimize,如一个月一次。 注意,在OPTIMIZE TABLE运行过程中,MySQL会锁定表。 转载于:...

    optimize table在优化MySQL时很重要。所以对于写比较频烦的表,要定期进行optimize,如一个月一次。

    注意,在OPTIMIZE TABLE运行过程中,MySQL会锁定表。

    转载于:https://www.cnblogs.com/loweringye/p/5854126.html

    展开全文
  • Uniform Optimize-crx插件

    2021-04-04 08:23:23
    通过Uniform Optimize扩展,您可以在运行Uniform Optimize的站点上可视化和处理个性化设置。 使用此扩展程序,您可以查看统一意图及其分数,编辑分数以实时测试个性化方案,以及在跟踪器在您的站点上运行时查看日志...
  • Scipy.Optimize

    万次阅读 2019-06-14 09:01:10
    1.Scipy.Optimize.Minimize 例子1:数学问题,非线性函数在约定条件下求解最小值问题 例子2:机器学习寻找参数 1.Scipy.Optimize.Minimize Source: ...

    目录

    1.Scipy.Optimize.Minimize

    例子1:数学问题,非线性函数在约定条件下求解最小值问题

    例子2:机器学习寻找参数


     

    1.Scipy.Optimize.Minimize

    Source:   https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html#scipy.optimize.minimize

     

    scipy.optimize.minimize(funx0args=()method=Nonejac=Nonehess=Nonehessp=Nonebounds=Noneconstraints=()tol=Nonecallback=Noneoptions=None)[source]

    fun callable

    The objective function to be minimized.

    fun(x, *args) -> float

    where x is an 1-D array with shape (n,) and args is a tuple of the fixed parameters needed to completely specify the function.

    #x是一维数组,目标函数所需的固定参数的元组,由后面的args初始化

    x0 ndarray, shape (n,)

    Initial guess. Array of real elements of size (n,), where ‘n’ is the number of independent variables.

    #初始化自变量参数

    args tuple, optional

    Extra arguments passed to the objective function and its derivatives (funjacand hess functions).

    #传递给目标函数的额外参数

    method:  str or callable, optional

    Method for computing the gradient vector.  

    #计算梯度的方法

    例子1:数学问题,非线性函数在约定条件下求解最小值问题

    Source:http://apmonitor.com/che263/index.php/Main/PythonOptimization

    min x1x4(x1+x2+x3)+x3 

    s.t.

    x1x2x3x4 \geq 25

    x1^{2} + x2^{2} + x3^{2} + x4^{2} = 40

    1 \leq x1,x2,x3,x4 \leq 5

    x0 = (1,5,5,1)

    Scipy.Optimize.Minimize is demonstrated for solving a nonlinear objective function

    subject to general inequality and equality constraints.

    def objective(x):
        x1 = x[0]
        x2 = x[1]
        x3 = x[2]
        x4 = x[3]
        return x1*x4*(x1+x2+x3)+x3
    
    def constraint1(x):
        return x[0]*x[1]*x[2]*x[3]-25.0
    
    def constraint2(x):
        sum_sq = 40
        for i in range(4):
            sum_sq = sum_sq - x[i]**2
        return sum_sq
    x0 = [1, 5 , 5, 1]
    print(objective(x0))
    #16
    
    b = (1.0 , 5.0)
    bnds = (b,b,b,b)
    cons1 = {'type' : 'ineq' , 'fun' : constraint1}
    cons2 = {'type' : 'eq' , 'fun' : constraint2}
    cons = [cons1,cons2]
    sol = minimize(objective, x0, method='SLSQP', bounds=bnds, constraints=cons)
    print(sol)
        fun: 17.01401724563517
         jac: array([14.57227015,  1.37940764,  2.37940764,  9.56415057])
     message: 'Optimization terminated successfully.'
        nfev: 30
         nit: 5
        njev: 5
      status: 0
     success: True
           x: array([1.        , 4.7429961 , 3.82115462, 1.37940765])

    例子2:机器学习寻找参数

    在吴恩达cs229的机器学习

    作业1中 linear_regression中,通过Gradient Descent方法,设置学习率,循环次数,进行寻找参数

    而在作业2中 logistic_regression中,我们采用scipy.optimize,minimize,去寻找参数。

    详细细节,请参考作业,这里只贴出关键代码

    Source : https://study.163.com/course/courseMain.htm?courseId=1004570029&_trace_c_p_k2_=00b4467624554d9fae0c292a58af0a45

    theta = theta=np.zeros(3) 
    
    def cost(theta, X, y):
        costf = np.mean(-y * np.log(sigmoid(X.dot(theta))) - (1 - y) * np.log(1 - sigmoid(X @ theta)))
        return costf
    
    def gradient(theta, X, y):   
        grad = (1 / len(X)) * X.T @ (sigmoid(X @ theta) - y)
        return grad
    import scipy.optimize as opt
    res = opt.minimize(fun=cost, x0=theta, args=(X, y), method='Newton-CG', jac=gradient)
    print(res)


     

    展开全文
  • Mysql OPTIMIZE TABLE

    2021-01-08 23:08:45
    13.7.2.4 OPTIMIZE TABLE Syntax OPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE tbl_name [, tbl_name] ... OPTIMIZE TABLE reorganizes the physical storage of table data and associated index data, to ...

    13.7.2.4 OPTIMIZE TABLE Syntax

    OPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE tbl_name [, tbl_name] ...

    OPTIMIZE TABLE reorganizes the physical storage of table data and associated index data, to reduce storage space and improve I/O efficiency when accessing the table. The exact changes made to each table depend on the storage engine used by that table.

    optimize table 重新组织表数据和相关索引数据的物理存储,以减少存储空间,提高访问表时的I/O效率。对每个表所做的确切更改取决于该表使用的存储引擎。

     

    Use OPTIMIZE TABLE in these cases, depending on the type of table:

    在这些情况下,根据表的类型使用“optimize table”:

    • After doing substantial insert, update, or delete operations on an InnoDB table that has its own.ibd file because it was created with the innodb_file_per_table option enabled. The table and indexes are reorganized, and disk space can be reclaimed for use by the operating system.

    在一个innodb表上操作大量的增删改操作,这个表有自己的.ibd文件,因为innodb_file_per_table选择被启用了。表和索引被重新组织,磁盘空间可以被回收以供操作系统使用。

     

    • After doing substantial insert, update, or delete operations on columns that are part of a FULLTEXT index in an InnoDB table. Set the configuration option innodb_optimize_fulltext_only=1 first. To keep the index maintenance period to a reasonable time, set the innodb_ft_num_word_optimize option to specify how many words to update in the search index, and run a sequence of OPTIMIZE TABLE statements until the search index is fully updated.

    在对一个innodb表的全文索引列做大量的增删改操作后。首先设置配置选项innodb_optimize_fulltext_only=1。要使索引维护周期保持在合理的时间内,请设置innodb_ft_num_word_optimize选项以指定搜索索引中要更新的单词数,并运行一系列optimize TABLE语句,直到搜索索引完全更新。

     

    • After deleting a large part of a MyISAM or ARCHIVE table, or making many changes to a MyISAM or ARCHIVE table with variable-length rows (tables that have VARCHAR, VARBINARY, BLOB, or TEXT columns). Deleted rows are maintained in a linked list and subsequent INSERT operations reuse old row positions. You can use OPTIMIZE TABLE to reclaim the unused space and to defragment the data file. After extensive changes to a table, this statement may also improve performance of statements that use the table, sometimes significantly.

    删除MyISAM或存档表的大部分,或对具有可变长度行(具有VARCHAR、VARBINARY、BLOB或TEXT列的表)的MyISAM或存档表进行多次更改之后。删除的行保存在链表中,后续的插入操作重用旧的行位置。可以使用“OPTIMIZE TABLE”回收未使用的空间并对数据文件进行碎片整理。在对表进行了大量更改之后,此语句还可以提高使用该表的语句的性能,有时会显著提高。

     

    This statement requires SELECT and INSERT privileges for the table.

    此语句需要表的SELECT和INSERT权限。(指optimize table语句)

     

    OPTIMIZE TABLE works for InnoDB, MyISAM, and ARCHIVE tables. OPTIMIZE TABLE is also supported for dynamic columns of in-memory NDB tables. It does not work for fixed-width columns of in-memory tables, nor does it work for Disk Data tables. The performance of OPTIMIZE on NDB Cluster tables can be tuned using --ndb-optimization-delay, which controls the length of time to wait between processing batches of rows by OPTIMIZE TABLE. For more information, see Previous NDB Cluster Issues Resolved in NDB Cluster 7.3.

    optimize table被用于innodb、myisam和archive三种存储引擎的表。同样也支持基于动态列的内存NDB表。它不适用于内存表的固定宽度列,也不适用于磁盘数据表。可以使用--ndb-optimization-delay来优化NDB集群表上的OPTIMIZE性能,它通过OPTIMIZE TABLE控制处理批处理行之间的等待时间长度。For more information, see Previous NDB Cluster Issues Resolved in NDB Cluster 7.3.

     

    For NDB Cluster tables, OPTIMIZE TABLE can be interrupted by (for example) killing the SQL thread performing the OPTIMIZE operation.

    对于NDB Cluster表,可以通过终止SQL线程来中断来执行优化操作。

     

    By default, OPTIMIZE TABLE does not work for tables created using any other storage engine and returns a result indicating this lack of support. You can make OPTIMIZE TABLE work for other storage engines by starting mysqld with the --skip-new option. In this case, OPTIMIZE TABLE is just mapped to ALTER TABLE.

    默认情况下,OPTIMIZE TABLE不适用于使用任何其他存储引擎创建的表,并返回一个结果,表明缺少支持。通过使用--skip-new选项启动mysqld,可以使优化表对其他存储引擎起作用。在这种情况下,OPTIMIZE TABLE只是映射到ALTER TABLE。

     

    This statement does not work with views.

    此语句不适用于视图。

     

    OPTIMIZE TABLE is supported for partitioned tables. For information about using this statement with partitioned tables and table partitions, see Section 22.3.4, “Maintenance of Partitions”.

    分区表支持OPTIMIZE TABLE。有关将此语句用于分区表和表分区的信息,请参阅第22.3.4节“分区的维护”。

     

    By default, the server writes OPTIMIZE TABLE statements to the binary log so that they replicate to replication slaves. To suppress logging, specify the optional NO_WRITE_TO_BINLOG keyword or its alias LOCAL.

    默认情况下,服务器将OPTIMIZE TABLE语句写入二进制日志,以便它们复制到复制从库。要禁止日志记录,请指定可选的NO_WRITE_TO_BINLOG关键字或其别名LOCAL。

     

    OPTIMIZE TABLE Output

     

    OPTIMIZE TABLE returns a result set with the columns shown in the following table.

    OPTIMIZE TABLE返回一个结果集,其列如下表所示。

    OPTIMIZE TABLE table catches and throws any errors that occur while copying table statistics from the old file to the newly created file. For example. if the user ID of the owner of the .frm, .MYD, or .MYI file is different from the user ID of the mysqld process, OPTIMIZE TABLE generates a "cannot change ownership of the file" error unless mysqld is started by the root user.

    OPTIMIZE TABLE TABLE捕获并抛出将表统计信息从旧文件复制到新创建的文件时发生的任何错误。例如。如果.frm、.MYD的所有者的用户ID,或.MYI文件与mysqld进程的用户ID不同,OPTIMIZE table 生成一个“cannot change ownership of the file“错误,除非mysqld由根用户启动。

     

    InnoDB Details

    For InnoDB tables, OPTIMIZE TABLE is mapped to ALTER TABLE ... FORCE, which rebuilds the table to update index statistics and free unused space in the clustered index. This is displayed in the output of OPTIMIZE TABLE when you run it on an InnoDB table, as shown here:

    对于InnoDB表,OPTIMIZE TABLE映射到ALTER TABLE。。。FORCE,它重建表以更新索引统计信息并释放聚集索引中未使用的空间。这将显示在InnoDB表上运行OPTIMIZE表时的输出,如下所示:

     

    OPTIMIZE TABLE uses online DDL for regular and partitioned InnoDB tables, which reduces downtime for concurrent DML operations. The table rebuild triggered by OPTIMIZE TABLE and performed under the cover by ALTER TABLE ... FORCE is completed in place. An exclusive table lock is only taken briefly during the prepare phase and the commit phase of the operation. During the prepare phase, metadata is updated and an intermediate table is created. During the commit phase, table metadata changes are committed.

    OPTIMIZE TABLE对常规和分区的InnoDB表使用在线DDL,这减少了并发DML操作的停机时间。由OPTIMIZE table触发的表重建,由ALTER TABLE ... FORCE 在后台执行。独占表锁仅在操作的准备阶段和提交阶段短暂使用。在准备阶段,更新元数据并创建中间表。在提交阶段,表元数据更改被提交。

     

    OPTIMIZE TABLE rebuilds the table using the table copy method under the following conditions:

    优化表在以下条件下使用table copy method重建表:


    • When the old_alter_table system variable is enabled.

    •当启用old_alter_table系统变量时。


    • When the mysqld --skip-new option is enabled

    •当启用--skip-new选项时启动mysql时。

     

    OPTIMIZE TABLE using online DDL is not supported for InnoDB tables that contain FULLTEXT indexes. The table copy method is used instead.

    对于包含全文索引的InnoDB表,不支持使用在线DDL优化表。改为使用表复制方法。

     

    InnoDB stores data using a page-allocation method and does not suffer from fragmentation in the same way that legacy storage engines (such as MyISAM) will. When considering whether or not to run optimize, consider the workload of transactions that your server will process:

    InnoDB使用page-allocation方法存储数据,不会像传统存储引擎(如MyISAM)那样出现碎片。在考虑是否运行优化时,请考虑服务器将处理的事务的工作负载:

    • Some level of fragmentation is expected. InnoDB only fills pages 93% full, to leave room for updates without having to split pages.

    •预计会出现一定程度的碎片。InnoDB只填充93%的页面,为更新留出空间,而不必拆分页。


    • Delete operations might leave gaps that leave pages less filled than desired, which could make it worthwhile to optimize the table.

    •删除操作可能会留下gaps,使页面的填充量低于预期,这可能会使优化表变得有价值。


    • Updates to rows usually rewrite the data within the same page, depending on the data type and row format, when sufficient space is available. See Section 14.9.1.5, “How Compression Works for InnoDB Tables” and Section 14.11, “InnoDB Row Formats”.

    •更新行通常会重写同一页中的数据,具体取决于数据类型和行格式,前提是有足够的空间可用。见第14.9.1.5节,“压缩工作原理”“InnoDB表”和第14.11节“InnoDB行格式”。

    • High-concurrency workloads might leave gaps in indexes over time, as InnoDB retains multiple versions of the same data due through its MVCC mechanism. See Section 14.3, “InnoDB Multi-Versioning”.

    •随着时间的推移,高并发性工作负载可能会在索引中留下gaps,因为InnoDB通过其MVCC机制保留同一数据的多个版本。见第14.3节,“InnoDB Multi-版本控制”。

     

     

    MyISAM Details

    For MyISAM tables, OPTIMIZE TABLE works as follows:
    1. If the table has deleted or split rows, repair the table.
    2. If the index pages are not sorted, sort them.
    3. If the table's statistics are not up to date (and the repair could not be accomplished by sorting the index), update them.

    如果表的统计信息不是最新的(并且无法通过排序索引来完成修复),请更新它们。

     

    Other Considerations

    OPTIMIZE TABLE is performed online for regular and partitioned InnoDB tables. Otherwise, MySQL
    locks the table during the time OPTIMIZE TABLE is running.

    定期在线执行optimize table和分区InnoDB表。因为,MySQL在OPTIMIZE table运行期间锁定表。


    OPTIMIZE TABLE does not sort R-tree indexes, such as spatial indexes on POINT columns. (Bug
    #23578)

    optimize table不会排序R-tree索引,例如空间在point列上。(Bug#23578)

     

     

     

     

     

     

     

     

     

     

     

     

    展开全文
  • oracle_optimize_sql Oracle SQL调优相关脚本
  • V-optimize-开源

    2021-07-19 11:19:29
    该项目的目标是提供一个方便的工具,以最佳地选择您的 Verizon Wireless“朋友和家人”联系人,以节省您每月的账单! V-optimize 是适用于任何 Windows 或 Linux 平台的控制台程序。
  • MySql 的Optimize

    2020-08-04 13:39:25
    1、optimize优化原理 对mysql进行大量增删改操作,磁盘上的空间没有被立即收回(数据空间、索引位),而是等待新的数据来填充空缺 -- 这些空间可以被后续的insert操作利用,但如果记录是变长的,那么不是所有的...
  • 当您的库中删除了大量的数据后,您可能会发现数据文件尺寸并没有...OPTIMIZE TABLE语法OPTIMIZE [LOCAL | NO_WRITE_TO_BINLOG] TABLE tbl_name [, tbl_name] … 如果您已经删除了表的一大部分,或者如果您已经对含有
  • Optimize GlassFish Performance
  • mysql optimize table

    2018-09-02 13:54:00
    OPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE tbl_name [, tbl_name] ... optimize table 会重组表数据和索引的物理存储,减少对存储空间使用和提升访问表时io效率。optimize table后,表的变化和存储引擎也...
  • scipy.optimize

    2020-01-09 14:30:45
    python线性规划(linear programming)与分配问题(assignment problem) scipy.optimize模块使用方法
  • gulp-optimize-js-源码

    2021-02-02 19:00:14
    gulp-optimize-js Gulp插件 感谢@nolanlawson的出色工作。 安装 npm install gulp-optimize-js --save-dev 用法 var optimizejs = require ( 'gulp-optimize-js' ) ; gulp . task ( 'optimize' , function ( ) { ...
  • 今天小编就为大家分享一篇python科学计算之scipy——optimize用法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
  • 不知道大家有没有遇到过这种情况,当我们导入scipy模块时,然后我们使用其中的optimize时总会提示module 'scipy' has no attribute 'optimize'。 代码如下: import scipy scipy.optimize.leastsq() """ module '...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 137,947
精华内容 55,178
关键字:

optimize