W
Size: a a a
W
T
T
D
D
CREATE TABLE docs01 (id SERIAL, doc TEXT, PRIMARY KEY(id));
CREATE TABLE invert01 (
keyword TEXT,
doc_id INTEGER REFERENCES docs01(id) ON DELETE CASCADE
);
Here are the one-line documents that you are to insert into docs01:
INSERT INTO docs01 (doc) VALUES
('skill and art in constructing the story and skill in story writing'),
('is improved by doing some writing and getting some feedback In'),
('programming our program is the story and the problem you are'),
('trying to solve is the idea'),
('Once you learn one programming language such as Python you will find it'),
('much easier to learn a second programming language such as JavaScript or'),
('C The new programming language has very different vocabulary and'),
('grammar but the problemsolving skills will be the same across all'),
('You will learn the vocabulary and sentences of Python pretty'),
('quickly It will take longer for you to be able to write a coherent');
Here is a sample for the first few expected rows of your reverse index:SELECT keyword, doc_id FROM invert01 ORDER BY keyword, doc_id LIMIT 10;
keyword | doc_id
-----------+--------
a | 6
a | 10
able | 10
across | 8
all | 8
and | 1
and | 2
and | 3
and | 7
and | 9
W
D
N
select *Limit (cost=6474.90..7076.74 rows=100 width=3179) (actual time=0.367..0.370 rows=1 loops=1)
from table
where (column @> '{xxx}')
limit 100;
select *Limit (cost=0.00..797.58 rows=10 width=3179) (actual time=130909.938..215844.333 rows=1 loops=1)
from table
where (column @> '{ххх}')
limit 10;
YS
D
SK
РЖ
KK
АА
RL
IK
KK
WITH rows AS (
INSERT INTO distributors
(did, dname)
VALUES
(DEFAULT, 'XYZ Widgets'),
(DEFAULT, 'ABC Widgets')
RETURNING 1
)
SELECT count(*) FROM rows;
KK
SK
Д