11-14-2007
Hey bakunin n kahuna
thanks a ton
i think i got to change my codes n look for other approach
as pointed by both of u rightly
"Also, normally SQL queries do not guarantee the order of records unless the order by clause is used. So, without order by, the same query executed twice could, theoretically, return the same records in two totally different orders."
there is no guarantee that order of records would be same ...
so simply matching row wise ... would not generate desired result
ll get back with new set of codes
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am very new to Unix. What are the similiarities and differences between ScoUnix and AIX5 if any? Where might i find the information? Which is better? (1 Reply)
Discussion started by: NewGuy100
1 Replies
2. Shell Programming and Scripting
Kindly help on follows.
I have 2 files. One file contains only one column of mobile numbers. And total records in a file 12 million. Second file contains 2 columns mobile numbers and balance. and total records 30 million. I want to find out balance of each data in file 1 corresponding to file 2.... (2 Replies)
Discussion started by: kamal_418
2 Replies
3. Shell Programming and Scripting
Hi,
I have a problem with comparison of two files
file1
20100101
20090101
20080101
20071001
20121229
file2
19990112 12 456 7
20011131 19
20100101 2 567 1 987
17890709 123 555
and, sh script needs to compare of these two files and give out to me result:
20100101 2 567 1 987
it... (5 Replies)
Discussion started by: shizik
5 Replies
4. Shell Programming and Scripting
Hello,
I have 2 files and I want them to be compared in a specific fashion
file1:
A_1200_1250
A_1251_1300
B_1301_1350
B_1351_1400
B_1401_1450
C_1451_1500 and so on...
file2:
1210 1305 1260 1295
1400 1500 1450 1495
Now The script should look for "1200" from A_1200_1250 of... (8 Replies)
Discussion started by: Diya123
8 Replies
5. Shell Programming and Scripting
Hi all
I have two files which I have to compare that whetehr there is soemthing common or not
body, div, table, thead, tbody, tfoot, tr, th, td, p { font-family: "Liberation Sans"; font-size: x-small; }
body, div, table, thead, tbody, tfoot,... (2 Replies)
Discussion started by: manigrover
2 Replies
6. Shell Programming and Scripting
Hi all,
I want to compare two files with same number of rows and columns with records in same order.
Just want to highlight the differences in the column values if any.
file A
1,kolkata,19,ab
2,delhi,89,cd
3,bangalore,56,ef
file2:
1,kolkata,21,ab
2,mumbai,89,gh
3,bangalore,11,kl... (9 Replies)
Discussion started by: prabhat.diwaker
9 Replies
7. Shell Programming and Scripting
Hi All ,
As I am new to unix scripting ,I need a help regarding unix scripting .I have two .txt files .One is source file and another is target file.I need a script through which I can compare those two files.I need a automated comparison report in a directory after comparing between source &... (2 Replies)
Discussion started by: STCET22
2 Replies
8. Shell Programming and Scripting
Hi All ,
I am aware of unix command ,but not comforable in putting together in script level.I came to situation where I need to compare between two .txt files fieldwise and need a mismatch report. As I am new to unix script arena ,if anyone can help in the below scenario that will be really... (9 Replies)
Discussion started by: STCET22
9 Replies
9. Shell Programming and Scripting
I have two files which has component name and version number separated by a space
cat file1
com.acc.invm:FNS_PROD 94.0.5
com.acc.invm:FNS_TEST_DCCC_Mangment 94.1.6
com.acc.invm:FNS_APIPlat_BDMap 100.0.9
com.acc.invm:SendEmail 29.6.113
com.acc.invm:SendSms 12.23.65
cat file2 ... (8 Replies)
Discussion started by: rakeshtomar82
8 Replies
10. Shell Programming and Scripting
I have the requirement
I have two files
cat fileA
something
anythg
nothing
everythg
cat fileB
everythg
anythg
Now i shld use fileB and compare every line at fileA and get the output as
something
nothing (3 Replies)
Discussion started by: Priya Amaresh
3 Replies
LEARN ABOUT REDHAT
cluster
CLUSTER(7) SQL Commands CLUSTER(7)
NAME
CLUSTER - cluster a table according to an index
SYNOPSIS
CLUSTER indexname ON tablename
INPUTS
indexname
The name of an index.
table The name (possibly schema-qualified) of a table.
OUTPUTS
CLUSTER
The clustering was done successfully.
DESCRIPTION
CLUSTER instructs PostgreSQL to cluster the table specified by table based on the index specified by indexname. The index must already have
been defined on tablename.
When a table is clustered, it is physically reordered based on the index information. Clustering is a one-time operation: when the table is
subsequently updated, the changes are not clustered. That is, no attempt is made to store new or updated tuples according to their index
order. If one wishes, one can periodically re-cluster by issuing the command again.
NOTES
In cases where you are accessing single rows randomly within a table, the actual order of the data in the heap table is unimportant. How-
ever, if you tend to access some data more than others, and there is an index that groups them together, you will benefit from using CLUS-
TER.
Another place where CLUSTER is helpful is in cases where you use an index to pull out several rows from a table. If you are requesting a
range of indexed values from a table, or a single indexed value that has multiple rows that match, CLUSTER will help because once the index
identifies the heap page for the first row that matches, all other rows that match are probably already on the same heap page, saving disk
accesses and speeding up the query.
During the cluster operation, a temporary copy of the table is created that contains the table data in the index order. Temporary copies of
each index on the table are created as well. Therefore, you need free space on disk at least equal to the sum of the table size and the
index sizes.
CLUSTER preserves GRANT, inheritance, index, foreign key, and other ancillary information about the table.
Because the optimizer records statistics about the ordering of tables, it is advisable to run ANALYZE on the newly clustered table. Other-
wise, the optimizer may make poor choices of query plans.
There is another way to cluster data. The CLUSTER command reorders the original table using the ordering of the index you specify. This can
be slow on large tables because the rows are fetched from the heap in index order, and if the heap table is unordered, the entries are on
random pages, so there is one disk page retrieved for every row moved. (PostgreSQL has a cache, but the majority of a big table will not
fit in the cache.) The other way to cluster a table is to use
SELECT columnlist INTO TABLE newtable
FROM table ORDER BY columnlist
which uses the PostgreSQL sorting code in the ORDER BY clause to create the desired order; this is usually much faster than an index scan
for unordered data. You then drop the old table, use ALTER TABLE...RENAME to rename newtable to the old name, and recreate the table's
indexes. However, this approach does not preserve OIDs, constraints, foreign key relationships, granted privileges, and other ancillary
properties of the table --- all such items must be manually recreated.
USAGE
Cluster the employees relation on the basis of its ID attribute:
CLUSTER emp_ind ON emp;
COMPATIBILITY
SQL92
There is no CLUSTER statement in SQL92.
SQL - Language Statements 2002-11-22 CLUSTER(7)