CS157b
Chris Pollett
Feb 12, 2020
Action on file | Dense Index | Sparse Index |
---|---|---|
Create Blocks | none | insert if sequential |
Delete Blocks | none | delete if sequential |
Insert | insert also into index | update(?) |
Delete | delete also from index | update(?) |
Slide | update | update(?) |
CREATE TABLE SOME_TABLE_NAME ( /*def of columns */ ) PCTFREE 15 PCTUSED 75;
Suppose we pre-allocate 10 blocks for a unsorted relation. Each block can typically hold five variable sized records. We are using PCTFREE=20, PCTUSED=40. Apply a sequence of operations to this relation/blocks where an insert has probability 5/6, and a delete has probability 1/6 (use dice). Keep going until either all blocks are at their limit or until a block gets re-added to the free block list. Show the state of the 10 blocks after each adding/deleting of records.
Post your solution to the Feb 12 In-Class Exercise Thread.
CREATE INDEX MY_INDEX ON MY_TABLE(MY_FIELD_1, ..., MY_FIELD_n);
Movie(title, year, length, genre, studioName, producerCertificateNo) Studio(name, address, presidentCertificateNo)Suppose a common query is:
SELECT title, year FROM Movie, Studio WHERE presidentCertificateNo = zzz AND Movie.studioName = Studio.name;