First look at the sample SQL statement to parse:
Copy Code code as follows:
SELECT * FROM dual
SELECT * from dual
Select C1,C2 from TB
Select C1,C2 from TB
Select COUNT (*) from T1
Select c1,c2,c3 from t1 where condi1=1
Select c1,c2,c3 from T1 Where condi1=1
Select C1,c2,c3 from T1,t2 wher
can add column family, alter ' T1 ', {NAME = ' F1 ', VERSIONS = 5} Put table disable after alter, then enable)column Qualifiers (columns qualifier)--------The data in the column family are positioned by column qualifiers or columns. Column qualifiers do not have to be defined beforehand. column qualifiers do not have to be consistent between peers, just like a row health, where the column qualifier has no data type and is always treated as a byte arr
Many data blocks in the HWL are non-data, but the data blocks in the high-water line need to be scanned during full table scanning. That is to say, oracle has to do a lot of useless work! Therefore, oracle provides the shrink space fragment function. For indexes, rebuild online can be used for fragment. Generally, DBAs that frequently perform DML operations should be regularly maintained, and statistics should be updated in a timely manner!I. Prepare test dataUse the HR user to create table
this object. as a result, access by other threads to all the synchronized code parts of the object is temporarily blocked.
5. The above rules apply to other Object locks.
Example:
1. When two concurrent threads access the synchronized (this) synchronization code block of the same object, only one thread can be executed within a time period. the other thread must wait until the current thread finishes executing this code block before executing this code block.
Package ths;
Public class thread1 i
blocked by other threads.
The third example also applies to other synchronized code blocks. That is, when a thread accesses a synchronized (this) synchronization code block of object, it obtains the object lock of the objects. As a result, access to all of the synchronization code portions of the object object by other threads is temporarily blocked.
The above rules apply to other object locks as well.
An example is provided:
First, when two concurrent threads access the synchronized (this)
In Oracle, how does one obtain user table information and other details ?, Oracle acquisition
1. Get the User Name of the current user
SELECT USERNAME FROM USER_USERS;
2. Obtain the names of all tables under a user.
SELECT TABLE_NAME FROM ALL_TABLES where owner = 'username'; -- case sensitive
3. Obtain the details of a table under the current user.
Select t. TABLE_NAME, -- table name T. COLUMN_NAME, -- field name T. DATA_TYPE, -- field type T. DATA_LENGTH, -- length T. NULLABLE -- whether it is
a partition is being locked in any mode, and all of its parents be locked in ' S ' mode.Based on this, the lock acquired for a operation is as follows:
Hive Command
Locks acquired
Select: T1 Partition P1
S on T1, T1. P1
INSERT into T2 (partition P2) Select: T1 Partit
The syntax for merge is as follows:MERGE [hint] into [schema.] table [T_alias] USING [schema.] {Table | view | subquery} [T_alias] On (condition) when matched and merge_update_clause when not matched then merge_insert_clause;What is merge and how is it used? Let's first look at a simple requirement:The requirement is to update the data from the T1 table to the T2 table. Assuming that the name of the T2 table already exists in the
statistics Total and proportion In the design of the database process, the teacher's information is usually set to a table, the school information will exist in another table, the same lesson information, published paper information will have a separate table, and then through the teacher name (or teacher number) connection query. So here's how the second statistic totals and proportions are described, assuming there is also a college table, as shown in: The table TEST_DEP structure is (DW_NA
Analysis of MySQL replace into statements (2)
This article mainly introduces the MySQL replace into Statement Analysis (2). This article focuses on several special case studies. For more information, see
1. Introduction
The previous article introduced the basic principles of replace. This chapter uses an example to describe the potential data quality risks caused by replace into. When a table involved in the replace into operation contains an auto-incrementing primary key, after the master-slave
returned.
UselessGROUP BYOr grouping functions,HAVINGAndWhereMerge (COUNT(),MIN() And so on ).
Construct a conciseWhereStatement to get a fasterWhereCalculate the value and skip the record as soon as possible.
All common tables in the query are read earlier than other tables. A constant table meets the following conditions:
Empty table or only one record.
WithUNIQUEIndex, orPRIMARY KEYOfWhereTable used together by the clause. Here, all index parts are compared with constant expressi
statement:CREATE TABLE Bys.t1 as SELECT * from Dba_objects;CREATE index bys.t1_idx on T1 (object_id);exec dbms_stats.gather_table_stats (' bys ', ' t1 ', cascade=>true,degree=>4);Set Autotrace trace;Select A.*,b.owner from t1 a,t1 b where a.object_name like '%t1% ' and a.ob
Label:I. Order of execution of SQL statements 1(8) SELECT (9) DISTINCT (11)top_specification> select_list>
2
3(1) fromleft_table>
4
5(3)Join_type>JOINright_table>
6
7(2) onjoin_condition>
8
9(4) WHEREwhere_condition>
Ten
One(5) GROUP bygroup_by_list>
A
- (6) with {CUBE | ROLLUP} -
the(7) havinghaving_condition>
-
-(Ten) ORDER byorder_by_list> Two. Test the execution order of the left join and where 1 Create a test table2 CREATE TABLE t
The syntax for merge is as follows:MERGE [hint] into [schema.] table [T_alias] USING [schema.] {Table | view | subquery} [T_alias] On (condition) when matched and merge_update_clause when not matched then merge_insert_clause;What is merge and how is it used? Let's first look at a simple requirement:The requirement is to update the data from the T1 table to the T2 table, and if the name of the T2 table already exists in the
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.