In the following example, a class test is defined, and the # Include # Include Using namespace STD;
Class test {Public:Int V;/* Constructor */Test (): V (0 ){}Test (const Int A): V (){}Test (const Test T1): V (t1.v ){}/* The following heavy loads are less than signs // Compare the sizes of two objectsBool operator Return (v }// Compare the object and INT sizeBool operator Return (v }// Compare the int an
Other properties or methods of the thread objectmethods for thread instance objects # isAlive (): Returns whether the thread is active. # getName (): Returns the thread name. # setName (): Sets the thread name. Some of the methods provided by the threading module are:# threading.currentthread (): Returns the current thread variable. # threading.enumerate (): Returns a list that contains the running thread. Running refers to threads that do not include pre-and post-termination thread
Copy Code code as follows:
'=====================================
' Get file suffix
'=====================================
Function get_filetxt (ByVal t0)
Dim T1
IF Len (t0) T1=split (T0, ".")
Get_filetxt=lcase (T1 (Ubound (t1))
End Function
'=====================================
' Read pure code for an
Index
Test table
CREATE TABLE t1 (a int primary key, b int) Engine=innodb;
INSERT into T1 values (1,1), (2,2), (3,3), (4,4);
InPlace ADD Index Processing processSql
ALTER TABLE T1 ADD index idx_t1_b (b);
Processing process
Sql_table.cc::mysql_alter_table (); To determine whether the current operation can be implemen
MYSQL demonstrates the isolation level of the relational database. the concurrent access to the relational database has the following problems:
Dirty read: For two things T1 and T2, T1 reads fields that have been updated by T2 .. If T2 is rolled back, the content read by T1 is temporary and invalid.
Non-repeated read: T1
It took a long time to see a friend importing data! There are actually a lot of quick methods to work out! There are many ways to insert data into a table, but the performance varies with different methods.
It took a long time to see a friend importing data! There are actually a lot of quick methods to work out! There are many ways to insert data into a table, but the performance varies with different methods.
It took a long time to see a friend importing data! There are actually a lot of q
thread ends due to an exception, a new thread will replace it. This thread pool ensures that all tasks are executed in the order they are submitted.
Test Case:
We create a Text thread for testing:
class Text implements Runnable{ String name; public Text(String name){ this.name = name; } @Override public void run() { System.out.println(Thread.currentThread().getName() + "--" + name); } }
Now let's test the effect of the threa
operation.
Because of the implementation relationship of the preceding business scenario, the database operations in an abstracted transaction are as follows:
Start transaction; // Start a transaction
Delete from 'order' where mermer_id = XXX; // Delete all orders under XXX
Insert into 'order' (mermer_id) values (xxx); // Inset multiple orders under XXX
Insert into 'order' (mermer_id) values (xxx );
Insert into 'order' (mermer_id) values (xxx );
..........
Commit; // transaction Commit
In the
1. Calculate the total score and rank each person Select name, sum (score) as allscore from stuscore group by name order by allscore2. Calculate the total score and rank each person Select distinct t1.name, t1.stuid, t2.allscore from stuscore t1, (select stuid, sum (score) as allscore from stuscore group by stuid) t2where t1
-----------------------------------------------------------------------------------------------------------
Gather Motion (slice1; segments: 1) (cost = 0. 00 .. 1.01 rows = 1 width = 6)
Rows out: 1 rows at destination with 2.032 ms to first row, 2.033 ms to end, start offset by 0.500 ms.
-> Seq Scan on gtt1 (cost = 0. 00 .. 1.01 rows = 1 width = 6)
Filter: id = 11 AND name: text = 'B': text
Rows out: 1 rows with 0.062 ms to first row, 0.065 ms to end, start offset by 328 ms.
Slice statistics:
(
1. Calculate the total score and rank each person
Select name, sum (score) as allscore from stuscore group by name order by allscore
2. Calculate the total score and rank each person
Select distinct t1.name, t1.stuid, t2.allscore from stuscore T1, (select stuid, sum (score) as allscore from stuscore group by stuid) t2where
= db3, old shema = db3, borrowed = true, fromSlaveDB = false, threadId = 52, charset = latin1, txIsolation = 3, autocommit = true, attachment = null, respHandler = null, host = 13.217.1.11, port = 3317, statusSync = null, writeQueue = 0, modifiedSQLExecuted = false]
5. Execute a simple query. If the shard field ID field is specified, query a single shard node through the shard.
Result of mycat command:
mysql> explain select * from ORDER0401 t1 wher
contains another # include file, it will also follow up and process each header file in order, so recursive ..)
3. Internal and external links:Internal and external links are relatively basic, but they are also the easiest and most common mistakes for new users. Therefore, we need to discuss them in detail here.Is the internal link generated only locally ?. OBJ, and the external link symbol is visible between all *. obj.For example, if inline is used, the variables directly declared in the file
View execution plans that have executed SQL
First, grab one of the most IO-consuming SQL in the last hour.
SELECT sql_id, COUNT (*)
from Gv$active_session_history Ash, gv$event_name evt
WHERE ash.sample_time > SYSDATE-1/24 and
ash.session_state = ' waiting ' and
ash.event_id = evt.event_id and
evt.wait_class = ' User i/ O '
GROUP by sql_id ORDER by
COUNT (*) DESC;
View SQL Execution Plan
SELECT * from TABLE (dbms_xplan.display_cursor (' 51f3uqkpv1fja '));
sql_id 51f3uqkpv1fja, child number
1. Calculate each person's total score and rank
Select Name,sum (Score) as Allscore from Stuscore Group by name ORDER by Allscore
2. Calculate each person's total score and rank
Select DISTINCT T1.name,t1.stuid,t2.allscore from Stuscore T1, (select Stuid,sum (Score) as Allscore to Stuscore Group by STUID) T2where T1
look at the normal assignment, such as code:
Copy Code code as follows:
Local Smartman = {
Name = "None",
Money = 9000000,
SayHello = function ()
Print ("Hello everyone, I am smart Hao.") ");
End
}
Local T1 = {};
Local MT = {
__index = Smartman,
}
Setmetatable (t1, MT);
T1.sayhello = function ()
Print ("en");
End
1. Inserting Datainserting a single row of data ( inserts a single row of data if the found statement contains a set keyword)GrammarInsert into table_name setfield 1>= value 1,field 2>= value 2,field 3>= value 3;First look at the table structuremysql> desc T1;+-------+-------------+------+-----+---------+-------+| Field | Type | Null | Key | Default | Extra |+-------+-------------+------+-----+---------+-------+| ID | Int (11) | YES | | NULL | || name
In Oracle, if the table data volume is large (m-level or larger), updating a field is very slow (for example, updating the historical business process table in my his project, 1.6 million records, use cursor to update, 1000 commit once, it took four days to complete the update), and later tried to improve:
1. Cancel logging on the table
2. Cancel the index of the table
But it is still very slow, but you can find this:
Http://asktom.oracle.com/pls/asktom/f? P = 100: 11: 0: p11_question_id: 640799
///------------------------------------------------------------------------------------------------// Function Definition: Name function (declarative), anonymous function (reference)// Declarative, defined Code Parsed before function Execution CodeFunction T1 (){Dwn ("T1 ");}T1 ();Function T1 (){Dwn ("New
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.