Remember a code refactoring

Single responsibility Single function Single function is the most basic requirement of SRP, that is to say, the function and responsibility of your class should be single, so that cohesion is high. For example, the following parameter class is used to query website Buyer information, according to SRP, it should be placed in the query Field. @Da ...

Added by jdaura on Wed, 07 Aug 2019 09:06:11 +0300

Mysql Misoperation Quick Restore Data

Mysql Misoperation Quick Restore Data background In the daily work process, ECM has a large number of scenarios of manual direct operation of the database to modify data, which is difficult to achieve absolute certainty. When there is no backup and a large amount of data is updated or deleted by mi ...

Added by Qaid on Wed, 07 Aug 2019 04:55:11 +0300

MySQL database-table operation-SQL statement

1. MySQL multi-table query 1.1 Foreign Key Constraints In order to eliminate the Cartesian product in multi-table queries, MySQL can use foreign key Association queries when building tables and performing key queries between multiple tables. Foreign key: Refer to the value of one column in Table 1 (sub) and another column in Table 2 (main), ...

Added by TVining on Tue, 06 Aug 2019 13:44:43 +0300

MySQL Case -- Optimizing OR Statement Trample Recording

Problem Description R&D colleagues feedback that an application is slow to execute, corresponding to SQL: UPDATE bs_serial_trac SET SERIAL_IS_LOCK = 0, LOCK_VALUE = '', UPDATE_USER = 'transSys' WHERE GOODS_NO = '4418095740626' AND ( PARENT_CODE = 'F9G7S19722001835' OR SERIAL = 'F9G7S19722001835' ); The index on table bs_s ...

Added by KC_Geek on Mon, 05 Aug 2019 11:48:33 +0300

Mapper configures dynamic SQL: if, choose, and foreach elements

Splicing of SQL Statements In the previous configuration, whether basic additions, deletions, modifications, or association nesting, set nested queries, the use of SQL statements are very basic, data operations between tables. Turn back to the code you wrote in your freshman year and splice the SQL ...

Added by kelesis on Mon, 05 Aug 2019 10:50:07 +0300

MySQL 8.0.17 Implementation Plan

1. SQL execution process 1.1 Internal execution of SQL statements MySQL is divided into Server layer and Storage Engine layer. Server layer includes connectors, analyzers, optimizers, executors and so on, while storage engine layer is responsible for data storage and reading.When SQL is executed, connections are established and privileges are o ...

Added by RandomEngy on Mon, 05 Aug 2019 06:47:34 +0300

security.php Source Analysis of OSSIM

Next, we begin to analyze the security.php source code, which is an important file of event in the dashboard sub-module. // Referencing files, initializing function libraries require_once 'av_init.php'; require_once 'sensor_filter.php'; require_once '../widget_common.php'; require_once 'common.php'; // Check if you have permission to ac ...

Added by kaukab on Sun, 04 Aug 2019 13:25:58 +0300

sql statement memorandum

Structured Query Language (SQL) is a special purpose programming language. It is a database query and programming language for accessing data, querying, updating and managing relational database systems. Add a self-increasing ID field ALTER TABLE tblname ADD COLUMN csmid COUNTER (0, 1) access creates a table with self-increasing fields CREATE T ...

Added by eugene2008 on Sat, 03 Aug 2019 10:03:49 +0300

[Oracle OCP 052-2-2] Deep analysis of checkpoint_change in Oracle database#

Links to the original text: https://wallimn.iteye.com/blog/1199561 Checkpoint classification 1. System checkpoints (recorded in control files) SQL> select checkpoint_change# from v$database; CHECKPOINT_CHANGE# ------------------ ...

Added by tonymontana on Fri, 02 Aug 2019 09:56:38 +0300

The Leftmost Principle of mysql Index

Building tables CREATE TABLE `user` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(10) DEFAULT NULL, `sex` tinyint(1) DEFAULT NULL, `age` tinyint(2) DEFAULT NULL, PRIMARY KEY (`id`), KEY `Index_user` (`name`,`age`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; Testing sql First mysql> exp ...

Added by wikstov on Wed, 31 Jul 2019 13:19:47 +0300