-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.psql_history
500 lines (500 loc) · 15.1 KB
/
.psql_history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
\i createBig.sql
\pwd!
pwd!/pwd!
\! pwd
\i createBig.sql
\q
psqlls/c coha
\c coha
\d
\i createBig.sql
SELECT * FROM lexicon where lemma = 'make';
SELECT * FROM lexicon where lemma = 'make';
SELECT * FROM sources where year = 1810 LIMIT 1;
SELECT * FROM lexicon where lemma = 'make' LIMIT 1;
SELECT * FROM lexicon where pos = 'nn%' LIMIT 5;
SELECT * FROM lexicon where pos LIKE 'nn%' LIMIT 5;
SELECT * FROM lexicon where pos LIKE 'y%' LIMIT 5;
SELECT * FROM lexicon where pos LIKE 'p%' LIMIT 5;
SELECT * FROM lexicon where pos LIKE 'i%' LIMIT 5;
\i createBig.sql
\i createBig.sql
\i createBig.sql
\i createBig.sql
\i createBig.sql
\i createBig.sql
\i createBig.sql
\i createBig.sql
\i createBig.sql
\i createBig.sql
\i createBig.sql
\i createBig.sql
\i createBig.sql
\i createBig.sql
\q
\d+
\c coha
\d+
\l+
\q
\c coha
\d+
\l+
exit
\q
\c coha
\d+
\d+
\d+
\d+
\d+
\d+
\d+
\d+
\d+
\d+
SELECT count(*) from corpus;
\d+
\d+
\q
\d+
\c coha
\d+
\d+
\d+
\d+
\d+
\d+
\d+
\d+
SELECT * from wordlines where id=42000001;
SELECT * from wordlines where id=42000002;
SELECT * from wordlines where id=42000003;
SELECT * from wordlines where id BETWEEN 42000000 and 42000005;
SELECT * FROM wordlines where id = 44000000;
SELECT * FROM wordlines where id = 43999999;
\d+
SELECT * from corpus where id = 100000000;
\d+
\d+
\d+
\d+
\d+
\d+
\d+\q
\d+\q
\c coha
\d+;
\d+;
\d+;
\d+;
\d+;
\d+;
\d+;
SELECT MAX(id) from corpus;
SELECT min(id) from corpus;
SELECT min(id) from wordlines;
SELECT max(id) from wordlines;
SELECT MAX(id) from corpus;
SELECT max(id) from wordlines;
SELECT MAX(id) from corpus;
SELECT MAX(id) from corpus;
SELECT max(id) from wordlines;
SELECT * from wordlines where id = 558863888;
SELECT * from corpus where id = 558863888;
SELECT * from wordlines where id = 558863888;
SELECT * from corpus where id = 558863889;
SELECT MAX(id) from corpus;
SELECT max(id) from wordlines;
SELECT count(*) from wordlines;
SELECT * from wordlines where id = 100001;
SELECT * from wordlines where id = 100001;
\q
\c coja
\c coha
SELECT min(id) from corpus;
\d+
\q
\q
\coha
\c coha
\i createBig.sql
pwd;
\! pwd
\i createBig.sql
ls
\i createBig.sql
\i fixline.sql
\i fixline.sql
\d+
\l+
select * from lexicon where lemma like "make";
select * from lexicon where lemma like "make";
select * from lexicon where lemma like 'make';
select wid from lexicon where lemma like 'make';
select * from wordlines, lexicon where lemma like 'make' and wid = w1;
select * from wordlines, lexicon where lemma like 'make' and wid = w1 LIMIT 1;
select * from lexicon where wid = 1;
select * from lexicon where word = offer;
select * from lexicon where word = 'offer';
SELECT * from corpus limit 1;
SELECT * from corpus where wid = 2531 LIMIT 1;
SELECT * from WORDLINES LIMIT 1;
SELECT * from WORDLINES where w1 = 2531 LIMIT 1;
SELECT * from WORDLINES where w1 = 3714 LIMIT 1;
select * from lexicon LIMIT 1;
select * from lexicon where wid = 2531;
select * from lexicon where wid = 122;
select * from lexicon where wid = 6311;
select * from lexicon where wid = 14101;
select * from lexicon where wid = 2;
select * from lexicon where wid = 3402;
select * from lexicon where wid = 3714;
select * from lexicon where wid = 1861297;
select * from lexicon where wid = 12671;
select * from lexicon where wid = 123;
select * from lexicon where wid = 1520;
SELECT * from WORDLINES where w1 = 2531 LIMIT 1;
SELECT * from WORDLINES where w1 = 2531 LIMIT 1;
SELECT * from WORDLINES where w1 = 2531 LIMIT 1;
SELECT * from WORDLINES where id BETWEEN 481762901 and 481762906;
SELECT * from WORDLINES where w1 = 3714 LIMIT 1;
SELECT * from WORDLINES where id BETWEEN 532581671 and 532581677;
select * from lexicon where wid = 1;
select * from lexicon where wid = 25;
select * from lexicon where wid = 3;
select * from lexicon where wid = 392;
select * from lexicon where wid = 153;
select * from lexicon where wid = 2720;
select * from lexicon where wid = 1;
select * from lexicon where wid = 1932;
2927;
select * from lexicon where wid = 2927;
select * from lexicon where wid = 2;
select * from lexicon where wid = 208;
\q
\c coha
\dt *.*
/dt public.*
\dt public.*
Select * from corpus limit 1;
;
Select * from corpus limit 1;
Select * from lexicon limit 1;
Select * from sources limit 1;
Select * from wordlines limit 1;
Select * from lexicon limit 1;
Select * from lexicon limit 1;
select * from corpus, lexicon where corpus.wid = lexicon.wid limit 1;
select * from corpus where wid = 1121109 limit 1;
\i pos.sql
\i mostcommonverb.sql
\i mostcommonverb.sql
\i mostcommonverb.sql
select * from lexicon where pos like '%vv%' limit 1;
select * from lexicon where pos like '%vv%' limit 20;
select * from lexicon where lemma="footnote";
select * from lexicon where lemma='footnote';
select * from lexicon where pos not like '%nn%' limit 20;
select * from lexicon where lemma='footnote' and pos not like '%nn%';
select * from lexicon where lemma='footnote' and pos not like '%nn%' and pos like '%vv%';
\i mostcommonverb.sql
\i mostcommonverb.sql
\i mostcommonverb2.sql
\i mostcommonverb3.sql
CREATE TABLE 500MostCommon (lemma varchar);
CREATE TABLE mostcommon (lemma varchar);
COPY mostcommon(lemma) FROM './var/lib/postgresql' DELIMITER ',';
pwd;
\! pwd
COPY mostcommon(lemma) FROM 'top500verbslemma' DELIMITER ',';
COPY mostcommon(lemma) FROM 'top500verbslemma.csv' DELIMITER ',';
COPY mostcommon(lemma) FROM './top500verbslemma.csv' DELIMITER ',';
COPY mostcommon(lemma) FROM '.\top500verbslemma.csv' DELIMITER ',';
COPY mostcommon(lemma) FROM './top500verbslemma.csv' DELIMITER ',';
COPY mostcommon(lemma) FROM 'top500verbslemma.csv' DELIMITER ',';
COPY mostcommon(lemma) FROM "top500verbslemma.csv" DELIMITER ',';
COPY mostcommon(lemma) FROM 'top500verbslemma.csv' DELIMITER ',';
COPY mostcommon(lemma) FROM 'top500verbslemma.csv' DELIMITER ',';
\! pwd
\! ls
\! cat top500verbslemma.csv
exitexitquitq
\q
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\c coha
\i example_partition.sql
\i example_partition.sql
select * from p1820;
\d+;
\d+;
select * from p1820;
\i example_partition.sql
\i example_partition.sql
\d+;
select * from p1820;
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
/d+;
\d+;
select * from p1830;
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\d+;
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\d+
\i example_partition.sql
\d+
\i example_partition.sql
\d+
\i example_partition.sql
\d+
SELECT * from p1820;
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\i example_partition.sql
\q
\c coha
116736000000More info;
SELECT pg_size_pretty(pg_database_size(mydb));
SELECT pg_size_pretty(pg_database_size(coha));
SELECT pg_size_pretty(pg_database_size("coha"));
SELECT pg_size_pretty(pg_database_size('coha'));
\q
\coha
\c coha
SELECT pg_size_pretty(pg_database_size("coha"));
SELECT pg_size_pretty(pg_database_size('coha'));
\q
\c coha
VACUUM FULL;
VACUUM FULL p1820;
VACUUM FULL p1830;
VACUUM FULL p1840;
VACUUM FULL p1850;
VACUUM FULL p1860;
VACUUM FULL p1870;
VACUUM FULL p1880;
VACUUM FULL p1890;
VACUUM FULL p1900;
VACUUM FULL p1910;
VACUUM FULL p1920;
VACUUM FULL p1930;
VACUUM FULL p1940;
VACUUM FULL p1950;
VACUUM FULL p1960;
VACUUM FULL p1970;
VACUUM FULL p1980;
VACUUM FULL p1990;
VACUUM FULL p2000;
\q
\c coha
d+;
/d+;
\d+
SELECT pg_size_pretty(pg_database_size('coha'));
\q
\l
\c sampleCOHA
SELECT pg_size_pretty(pg_database_size('samplecoha'));
SELECT pg_size_pretty(pg_database_size('sampleCOHA'));
\q
\c coha
\i example_partition.sql
\q
\c coha
\i example_partition.sql
d+;
\dt;
SELECT Count(*) from p1820;
SELECT Count(*) from p1830;
SELECT * from p1820 limit 1;
SELECT COUNT(DISTINCT source) FROM p1820;
SELECT COUNT(DISTINCT source) FROM p1830;
SELECT COUNT(DISTINCT source) FROM p1840;
SELECT COUNT(DISTINCT source) FROM p1850;
SELECT COUNT(DISTINCT source) FROM p1860;
SELECT COUNT(DISTINCT source) FROM p1870;
SELECT Count(*) from p1870;
SELECT Count(*) from p1880;
SELECT Count(*) from p2000;
SELECT Count(*) from p1990;
SELECT SUM(DISTINCT source) FROM p1820;
SELECT SUM(DISTINCT source) FROM p1830;
SELECT Count(*) from p1820;
SELECT source, Count(*) from p1820 group by source;
SELECT source, Count(*) from p1820 group by source sort desc;
SELECT source, Count(*) from p1820 group by source Order by source;
SELECT source, Count(*) from p1830 group by source Order by source;
\d+
select * from sources limit 1;
select * from sources where textid = 4118;
Select * from p1830 where textid = 4118;
Select * from p1830 where source = 4118 limit 1;
Select count(*) from p1830 where source = 4118;
lsSelect * from lexicon limit 1;
lsSelect * from lexicon limit 1;
Select * from lexicon limit 1;
Select wordcs from lexicon, p1830 where p1830.source = 4118 and p1830.w1 = lexicon.wid;
Select wordcs, w1 from lexicon, p1830 where p1830.source = 4118 and p1830.w1 = lexicon.wid;
Select wordcs, w1 from lexicon, p1830 where p1830.source = 4118 and p1830.w1 = lexicon.wid order by p1830.id;
Select lemma, count(*) from lexicon, p1820 where lexicon.pos like '%vv%' and not like '%nn%' group by lemma order by count(*) DESC;
Select lemma, count(*) from lexicon, p1820 where lexicon.pos like '%vv%' and lexicon.pos not like '%nn%' group by lelexiconmma order by count(*) DESC;
Select lemma, count(*) from lexicon, p1820 where lexicon.wid = p1820.w1 and lexicon.pos like '%vv%' and not like '%nn%' group by lemma order by count(*) DESC;
Select lemma, count(*) from lexicon, p1820 where lexicon.wid = p1820.w1 and lexicon.pos like '%vv%' and lexicon.pos not like '%nn%' group by lemma order by count(*) DESC;
Select lemma, count(*) from lexicon, p1830 where lexicon.wid = p1830.w1 and lexicon.pos like '%vv%' and lexicon.pos not like '%nn%' group by lemma order by count(*) DESC;
SELECT count(*) from p1820, lexicon where p1820.w1 = lexicon.wid and lexicon.pos not like 'not';
SELECT count(*) from p1820, lexicon where p1820.w1 = lexicon.wid and lexicon.pos not like 'y';
\i test_part_collocates.sql
\i test_part_collocates.sql
\i test_part_collocates.sql
\i test_part_collocates.sql
\i test_part_collocates.sql
SELECT c.w2 FROM p1820 as c, lexicon as l where l.lemma like 'grant' and c.w1 = l.wid and l.pos = '%vv%';
SELECT c.w2 FROM p1820 as c, lexicon as l where l.lemma like 'grant' and c.w1 = l.wid;
\i test_part_collocates.sql
\i test_part_collocates.sql
\i test_part_collocates.sql
\i test_part_collocates.sql
\i queryPartitions.sql
\i queryPartitions.sql
\i queryPartitions.sql
\i queryPartitions.sql
Select lemma, count(*) from lexicon, p1820 where lexicon.pos like '%vv%' and not like '%nn%' group by lemma order by count(*) DESC;
Select lemma, count(*) from lexicon, p1830 where lexicon.wid = p1830.w1 and lexicon.pos like '%vv%' and lexicon.pos not like '%nn%' group by lemma order by count(*) DESC;
COPY ( Select lemma, count(*) from lexicon, p1820 where lexicon.wid = p1820.w1 and lexicon.pos like '%vv%' and lexicon.pos not like '%nn%' group by lemma order by count(*) DESC) TO 'var/lib/postgresql/1820mostcommonverb.csv';
COPY ( Select lemma, count(*) from lexicon, p1820 where lexicon.wid = p1820.w1 and lexicon.pos like '%vv%' and lexicon.pos not like '%nn%' group by lemma order by count(*) DESC) TO '1820mostcommonverb.csv';
COPY ( Select lemma, count(*) from lexicon, p1820 where lexicon.wid = p1820.w1 and lexicon.pos like '%vv%' and lexicon.pos not like '%nn%' group by lemma order by count(*) DESC) TO './1820mostcommonverb.csv';
COPY ( Select lemma, count(*) from lexicon, p1820 where lexicon.wid = p1820.w1 and lexicon.pos like '%vv%' and lexicon.pos not like '%nn%' group by lemma order by count(*) DESC
COPY ( Select lemma, count(*) from lexicon, p1820 where lexicon.wid = p1820.w1 and lexicon.pos like '%vv%' and lexicon.pos not like '%nn%' group by lemma order by count(*) DESC ) TO '~/1820mostcommonverb.csv' CSV HEADER;
\copy ( Select lemma, count(*) from lexicon, p1820 where lexicon.wid = p1820.w1 and lexicon.pos like '%vv%' and lexicon.pos not like '%nn%' group by lemma order by count(*) DESC ) TO '~/1820mostcommonverb.csv' CSV HEADER;
\copy ( Select lemma, count(*) from lexicon, p1830 where lexicon.wid = p1830.w1 and lexicon.pos like '%vv%' and lexicon.pos not like '%nn%' group by lemma order by count(*) DESC ) TO '~/1830mostcommonverb.csv' CSV HEADER;
\i mostcommonpartitionselect.sql
\i mostcommonpartitionselect.sql
\i mostcommonpartitionselect.sql
\d+;
\l
\l+
\q
\i queryPartitionsPart2.sql
\c coha
\i queryPartitionsPart2.sql
\q
\c coha
\q
\c coha
d+;
\d+;
\q
\c coha
\i example_partition-Algoselect.sql
\d+
\i example_partition-Algoselect.sql
\i example_partition-Algoselect.sql
\d+
select * from p1820algo limit 5;
\q
\c coha
\d+;
\i algoQueryPartitions.sql
\i algoQueryPartitions.sql
\i algoQueryPartitions.sql
\d+;
\q
\c coha
\d+
\i 1940reselect.sql
quit
\q
\d+
\c coha
\d+
lslsexit]q
\q
\c coha
\d+
select * sources limit 10;
select * from sources limit 10;
select * from p2000algo limit 10;
select * from sources as s, p2000algo as p where s.textid = p.source;
select * from sources as s, p2000algo as p where s.textid = p.source limit 10;
select * from sources as s, p2000algo as p where s.textid = p.source limit 20;
select * from sources as s, p2000algo as p where s.textid = p.source and genre = 'FIC' limit 20;
SELECT c.w2 FROM p1820algo as c, lexicon as lwhere l.lemma like 'bear'and c.w1 = l.wid;
SELECT * FROM p1820algo as c, lexicon as lwhere l.lemma like 'bear'and c.w1 = l.wid;
SELECT * FROM p1820algo as c, lexicon as l, source as swhere l.lemma like 'bear'and c.w1 = l.wid limit 10;
SELECT * FROM p1820algo as c, lexicon as l, sources as swhere l.lemma like 'bear'and c.w1 = l.wid limit 10;
SELECT * FROM p1960algo as c, lexicon as l, sources as swhere l.lemma like 'bear'and c.w1 = l.wid and s.textid = c.source and s.genre = 'MAG' limit 10;
\q
\c coha
exit
\q
\c coha
\d+
exotexit
\q