Team,
How data are stored when creating Primary key on a table? I believe its Physical Order.
I have created a table as below.
CREATE TABLE supplier
(
supplier_id numeric(10) not null,
supplier_name varchar2(50) not null,
contact_name varchar2(50),
CONSTRAINT supplier_pk PRIMARY KEY (supplier_id)
);
insert into supplier values (1,'abcd','efgh');
insert into supplier values (2,'abcd','efgh');
insert into supplier values (3,'abcd','efgh');
commit;
Retrieving rows,
select rowid, a.* from supplier a order by supplier_id
| ROWID | SUPPLIER_ID | SUPPLIER_NAME | CONTACT_NAME |
|---|
| ACF9/aAAUAAAAFlAAB | 1 | abcd | efgh |
| ACF9/aAAUAAAAFlAAC | 2 | abcd | efgh |
| ACF9/aAAUAAAAFkAAB | 3 | abcd | efgh |
Deleting supplier_id =2,
delete from supplier where supplier_id =2
| ROWID | SUPPLIER_ID | SUPPLIER_NAME | CONTACT_NAME |
|---|
| ACF9/aAAUAAAAFlAAB | 1 | abcd | efgh |
| ACF9/aAAUAAAAFkAAB | 3 | abcd | efgh |
If it is physical sort order, row_id of supplier_id (3) should more to row_id of supplier_id (2), but it didnt happen.
Can anyone explain how to data are stored in blocks?
Regards,
Praveen