, the IBM official website has detailed steps on this operation, interested peers can read, Links: http://www.ibm.com/developerwork ... achments/index.html2, DESC (Domino Enterprise Connection Services)DECs's English full name is Domino Enterprise Connection Services, a subset of Lei, which is just a live notes activity. DECs is a wizard-based server task that is included in the Domino 4.6.3 and its later versions. It modifies the Notes.ini file to in
Using Reverse indexes to Improve the Performance of order by desc using reverse indexes (index desc) can greatly improve the performance of SQL statements with order by desc clauses. I. Scenario 1. Table Name: test_t, with a field name: object_id2, total data volume: 580000 rows, segment_size: 72MB3, Where condition (Owner = 'sys 'and Object_id> 50000) rows: 3247
SELECT * FROM table where yz= ' 1 ' ORDER BY btcount Desc This writes output is incorrect,
Btcount This field is very short, generally =0 or = 1, maximum no more than =8
When the amount of data is large, you cannot press the Btcount value of greater than the arrangement, do not know why?
By time and correctly sorted: SELECT * from table where yz= ' 1 ' ORDER by time Desc
Is the Btcount not sorted co
Note: Use the BTREE compound to index the ASC/DESC of each field to optimize the orderby query efficiency.The tbl_direct_pos_201506 table has 1.9 million data, DDL:
Create table 'tbl _ direct_pos_201506 '('acq _ ins_code' char (13) not null default ''comment' mechanism Code', 'trace _ num' char (6) not null default ''comment' trace NO. ', 'Trans _ datetime' char (10) not null default ''comment' transaction time', 'process _ flag' char (1) default null
The solution is to add a sorting Field in order by ID desc, which may increase the speed a lot. The sorting field is different from the query field.
Such as table
Copy codeThe Code is as follows: create table [dbo]. [CMPP_SendCentre] (
[Id] [int] IDENTITY (1, 1) not null,
[SendType] [varchar] (10) COLLATE Chinese_PRC_CI_AS not null,
[SendDate] [datetime] not null,
[Port] [varchar] (50) COLLATE Chinese_PRC_CI_AS not null,
[Service_ID] [varchar] (20) CO
The boss gave a task, search the information, think it is better to summarize. What if I use it later? Around two topics: one is the ability to index on a view, and the other is whether the DESC keyword can be used when creating an index.One, can I create an index on a viewBecause the normal view does not store the actual information, the data it operates on is from the base table, so it is not possible to create an index on a normal view.Execute the
Over cannot be used alone, with analytic functions: Rank (), Dense_rank (), Row_number (), and so on.Its parameters: Over (partition by columnname1 ORDER by Columnname2)Meaning: Group by the field specified by Columname1, or by the value of field columnname1 to sort by group.For example: In the Employees table, there are two records for the department: department_id = 10 and 20Select Department_id,rank () over (partition by department_id order by salary) from employees is the ranking of salaries
using the reverse index (index DESC), you can significantly increase the performance of SQL statements with an ORDER BY DESC clause.
first, the scene
1, table name: test_t, there is a field named object_id
2, total data quantity: 580000 line, SEGMENT_SIZE:72MB
3 Number of rows in the Where condition (owner= ' SYS ' and object_id>50000): 32472 rows
4. SQL statement: SELECT * from test_t where owner= ' SYS
ORDER BY descending desc, ascending ASC by age descending
Select *from Student ORDER BY age DESCAscending by age
Select *from Student ORDER BY age ASCRank function rank () in descending order of use age, if the sort field is the same, rank equal
Select *,rank () over (DESC) as rank from studentSorted by age after sex grouping, equal rank if the sort field is the same
Partition by group
Select *,rank () over
' |+------+------+------------ -----+--------+---------+------+--------------+---------------------------------------------------------------- --------------------------------------+2rowsinset (0.00NBSP;SEC)Obviously wrong, it's too slow to take this statement out alone. 48s.Explain analyze this statement:Mysql>explainselecta.id,a.q_user,a.q_showtime,a.thumb,a.title,a.q_uid,qishu,announced_ type,q_end_time, (select ' time ' FROM ' Go_member_go_record ' whereshopid= a.idORDERBY ' time ' DESCLIMI
CauseThe data is sorted in three dimensions, with the result that the results of two of the orderBy(desc("col")) dimensions are returned correctly, and the result in the other dimension appears to be the result of a large row, the result of the error is probably as follows:wang:2.072661zhe:19.702593rong:1.778491The correct dimension is as follows:wang:17.069210zhe:1.936609rong:1.926417yao:1.886525Investigation
Think it is the wrong data, and
Label:Often forget MySQL in ascending and descending with what characters, now make a note: ascending asc, descending desc, for example, the following is a time descending call column of the article, also is the column of the latest article[e:loop={"Select ClassID, ClassName, classpath from ' [!db.pre!] Enewsclass ' where classid=275 order BY classid desc limit 9 ", 100,24,0}]Remember to be healthierNOTES
The MySQL desc command is used to view the table structure, which is the shorthand form for the describe command.
MySQL desc command syntax:
DESC TableName
What information does the command display on the table? The specific include:
Fields Name (field)
field type (type)
Whether the field is null
Whether the field is a primary key (key)
Defa
The workaround is to add a sorted field to the order by ID Desc, which can improve the speed a lot. The sorted fields vary by query
such as table
Copy Code code as follows:
CREATE TABLE [dbo]. [Cmpp_sendcentre] (
[ID] [int] IDENTITY (1, 1) not NULL,
[Sendtype] [varchar] (a) COLLATE chinese_prc_ci_as not NULL,
[Senddate] [DateTime] Not NULL,
[Port] [varchar] (m) COLLATE chinese_prc_ci_as not NULL,
[SERVICE_ID] [varchar] (COLLATE) chin
Ow_number () over (PARTITION by COL1 Order by COL2) indicates that sorting is based on COL1 within the grouping according to COL2 grouping, and the value computed by this function represents the sequential number of each set of internally ordered (contiguous unique within the group)Practical applicationTake the latest dataSELECT * FROM (Select Hlpr.emplid, Hlpr.deptid, Hlpr.create_time,Row_number () over (partition by hlpr.emplid ORDER BY hlpr.create_time De
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.