]> Sergey Matveev's repositories - public-inbox.git/blob - lib/PublicInbox/OverIdx.pm
173e322096bcfe406898717a4ff52e23f6650824
[public-inbox.git] / lib / PublicInbox / OverIdx.pm
1 # Copyright (C) 2018-2020 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
3
4 # for XOVER, OVER in NNTP, and feeds/homepage/threads in PSGI
5 # Unlike Msgmap, this is an _UNSTABLE_ cache which can be
6 # tweaked/updated over time and rebuilt.
7 #
8 # Ghost messages (messages which are only referenced in References/In-Reply-To)
9 # are denoted by a negative NNTP article number.
10 package PublicInbox::OverIdx;
11 use strict;
12 use v5.10.1;
13 use parent qw(PublicInbox::Over);
14 use IO::Handle;
15 use DBI qw(:sql_types); # SQL_BLOB
16 use PublicInbox::MID qw/id_compress mids_for_index references/;
17 use PublicInbox::Smsg qw(subject_normalized);
18 use Compress::Zlib qw(compress);
19 use Carp qw(croak);
20
21 sub dbh_new {
22         my ($self) = @_;
23         my $dbh = $self->SUPER::dbh_new($self->{-no_fsync} ? 2 : 1);
24
25         # 80000 pages (80MiB on SQLite <3.12.0, 320MiB on 3.12.0+)
26         # was found to be good in 2018 during the large LKML import
27         # at the time.  This ought to be configurable based on HW
28         # and inbox size; I suspect it's overkill for many inboxes.
29         $dbh->do('PRAGMA cache_size = 80000');
30
31         create_tables($dbh);
32         $dbh;
33 }
34
35 sub new {
36         my ($class, $f) = @_;
37         my $self = $class->SUPER::new($f);
38         $self->{min_tid} = 0;
39         $self;
40 }
41
42 sub get_counter ($$) {
43         my ($dbh, $key) = @_;
44         my $sth = $dbh->prepare_cached(<<'', undef, 1);
45 SELECT val FROM counter WHERE key = ? LIMIT 1
46
47         $sth->execute($key);
48         $sth->fetchrow_array;
49 }
50
51 sub adj_counter ($$$) {
52         my ($self, $key, $op) = @_;
53         my $dbh = $self->{dbh};
54         my $sth = $dbh->prepare_cached(<<"");
55 UPDATE counter SET val = val $op 1 WHERE key = ?
56
57         $sth->execute($key);
58
59         get_counter($dbh, $key);
60 }
61
62 sub next_tid { adj_counter($_[0], 'thread', '+') }
63 sub next_ghost_num { adj_counter($_[0], 'ghost', '-') }
64
65 sub id_for ($$$$$) {
66         my ($self, $tbl, $id_col, $val_col, $val) = @_;
67         my $dbh = $self->{dbh};
68         my $in = $dbh->prepare_cached(<<"")->execute($val);
69 INSERT OR IGNORE INTO $tbl ($val_col) VALUES (?)
70
71         if ($in == 0) {
72                 my $sth = $dbh->prepare_cached(<<"", undef, 1);
73 SELECT $id_col FROM $tbl WHERE $val_col = ? LIMIT 1
74
75                 $sth->execute($val);
76                 $sth->fetchrow_array;
77         } else {
78                 $dbh->last_insert_id(undef, undef, $tbl, $id_col);
79         }
80 }
81
82 sub sid {
83         my ($self, $path) = @_;
84         return unless defined $path && $path ne '';
85         id_for($self, 'subject', 'sid', 'path' => $path);
86 }
87
88 sub mid2id {
89         my ($self, $mid) = @_;
90         id_for($self, 'msgid', 'id', 'mid' => $mid);
91 }
92
93 sub delete_by_num {
94         my ($self, $num, $tid_ref) = @_;
95         my $dbh = $self->{dbh};
96         if ($tid_ref) {
97                 my $sth = $dbh->prepare_cached(<<'', undef, 1);
98 SELECT tid FROM over WHERE num = ? LIMIT 1
99
100                 $sth->execute($num);
101                 $$tid_ref = $sth->fetchrow_array; # may be undef
102         }
103         foreach (qw(over id2num)) {
104                 $dbh->prepare_cached(<<"")->execute($num);
105 DELETE FROM $_ WHERE num = ?
106
107         }
108 }
109
110 # this includes ghosts
111 sub each_by_mid {
112         my ($self, $mid, $cols, $cb, @arg) = @_;
113         my $dbh = $self->{dbh};
114
115 =over
116         I originally wanted to stuff everything into a single query:
117
118         SELECT over.* FROM over
119         LEFT JOIN id2num ON over.num = id2num.num
120         LEFT JOIN msgid ON msgid.id = id2num.id
121         WHERE msgid.mid = ? AND over.num >= ?
122         ORDER BY over.num ASC
123         LIMIT 1000
124
125         But it's faster broken out (and we're always in a
126         transaction for subroutines in this file)
127 =cut
128
129         my $sth = $dbh->prepare_cached(<<'', undef, 1);
130 SELECT id FROM msgid WHERE mid = ? LIMIT 1
131
132         $sth->execute($mid);
133         my $id = $sth->fetchrow_array;
134         defined $id or return;
135
136         push(@$cols, 'num');
137         $cols = join(',', map { $_ } @$cols);
138         my $lim = 10;
139         my $prev = get_counter($dbh, 'ghost');
140         while (1) {
141                 $sth = $dbh->prepare_cached(<<"", undef, 1);
142 SELECT num FROM id2num WHERE id = ? AND num >= ?
143 ORDER BY num ASC
144 LIMIT $lim
145
146                 $sth->execute($id, $prev);
147                 my $nums = $sth->fetchall_arrayref;
148                 my $nr = scalar(@$nums) or return;
149                 $prev = $nums->[-1]->[0];
150
151                 $sth = $dbh->prepare_cached(<<"", undef, 1);
152 SELECT $cols FROM over WHERE over.num = ? LIMIT 1
153
154                 foreach (@$nums) {
155                         $sth->execute($_->[0]);
156                         my $smsg = $sth->fetchrow_hashref;
157                         $smsg = PublicInbox::Over::load_from_row($smsg);
158                         $cb->($self, $smsg, @arg) or return;
159                 }
160                 return if $nr != $lim;
161         }
162 }
163
164 sub _resolve_mid_to_tid {
165         my ($self, $smsg, $tid) = @_;
166         my $cur_tid = $smsg->{tid};
167         if (defined $$tid) {
168                 merge_threads($self, $$tid, $cur_tid);
169         } elsif ($cur_tid > $self->{min_tid}) {
170                 $$tid = $cur_tid;
171         } else { # rethreading, queue up dead ghosts
172                 $$tid = next_tid($self);
173                 my $num = $smsg->{num};
174                 push(@{$self->{-ghosts_to_delete}}, $num) if $num < 0;
175         }
176         1;
177 }
178
179 # this will create a ghost as necessary
180 sub resolve_mid_to_tid {
181         my ($self, $mid) = @_;
182         my $tid;
183         each_by_mid($self, $mid, ['tid'], \&_resolve_mid_to_tid, \$tid);
184         if (my $del = delete $self->{-ghosts_to_delete}) {
185                 delete_by_num($self, $_) for @$del;
186         }
187         $tid // do { # create a new ghost
188                 my $id = mid2id($self, $mid);
189                 my $num = next_ghost_num($self);
190                 $num < 0 or die "ghost num is non-negative: $num\n";
191                 $tid = next_tid($self);
192                 my $dbh = $self->{dbh};
193                 $dbh->prepare_cached(<<'')->execute($num, $tid);
194 INSERT INTO over (num, tid) VALUES (?,?)
195
196                 $dbh->prepare_cached(<<'')->execute($id, $num);
197 INSERT INTO id2num (id, num) VALUES (?,?)
198
199                 $tid;
200         };
201 }
202
203 sub merge_threads {
204         my ($self, $winner_tid, $loser_tid) = @_;
205         return if $winner_tid == $loser_tid;
206         my $dbh = $self->{dbh};
207         $dbh->prepare_cached(<<'')->execute($winner_tid, $loser_tid);
208 UPDATE over SET tid = ? WHERE tid = ?
209
210 }
211
212 sub link_refs {
213         my ($self, $refs, $old_tid) = @_;
214         my $tid;
215
216         if (@$refs) {
217                 # first ref *should* be the thread root,
218                 # but we can never trust clients to do the right thing
219                 my $ref = $refs->[0];
220                 $tid = resolve_mid_to_tid($self, $ref);
221                 merge_threads($self, $tid, $old_tid) if defined $old_tid;
222
223                 # the rest of the refs should point to this tid:
224                 foreach my $i (1..$#$refs) {
225                         $ref = $refs->[$i];
226                         my $ptid = resolve_mid_to_tid($self, $ref);
227                         merge_threads($self, $tid, $ptid);
228                 }
229         } else {
230                 $tid = $old_tid // next_tid($self);
231         }
232         $tid;
233 }
234
235 sub parse_references ($$$) {
236         my ($smsg, $hdr, $mids) = @_;
237         my $refs = references($hdr);
238         push(@$refs, @$mids) if scalar(@$mids) > 1;
239         return $refs if scalar(@$refs) == 0;
240
241         # prevent circular references here:
242         my %seen = ( $smsg->{mid} => 1 );
243         my @keep;
244         foreach my $ref (@$refs) {
245                 if (length($ref) > PublicInbox::MID::MAX_MID_SIZE) {
246                         warn "References: <$ref> too long, ignoring\n";
247                         next;
248                 }
249                 push(@keep, $ref) unless $seen{$ref}++;
250         }
251         $smsg->{references} = '<'.join('> <', @keep).'>' if @keep;
252         \@keep;
253 }
254
255 # normalize subjects so they are suitable as pathnames for URLs
256 # XXX: consider for removal
257 sub subject_path ($) {
258         my ($subj) = @_;
259         $subj = subject_normalized($subj);
260         $subj =~ s![^a-zA-Z0-9_\.~/\-]+!_!g;
261         lc($subj);
262 }
263
264 sub ddd_for ($) {
265         my ($smsg) = @_;
266         my $dd = $smsg->to_doc_data;
267         utf8::encode($dd);
268         compress($dd);
269 }
270
271 sub add_overview {
272         my ($self, $eml, $smsg) = @_;
273         $smsg->{lines} = $eml->body_raw =~ tr!\n!\n!;
274         my $mids = mids_for_index($eml);
275         my $refs = parse_references($smsg, $eml, $mids);
276         my $subj = $smsg->{subject};
277         my $xpath;
278         if ($subj ne '') {
279                 $xpath = subject_path($subj);
280                 $xpath = id_compress($xpath);
281         }
282         add_over($self, $smsg, $mids, $refs, $xpath, ddd_for($smsg));
283 }
284
285 sub _add_over {
286         my ($self, $smsg, $mid, $refs, $old_tid, $v) = @_;
287         my $cur_tid = $smsg->{tid};
288         my $n = $smsg->{num};
289         die "num must not be zero for $mid" if !$n;
290         my $cur_valid = $cur_tid > $self->{min_tid};
291
292         if ($n > 0) { # regular mail
293                 if ($cur_valid) {
294                         $$old_tid //= $cur_tid;
295                         merge_threads($self, $$old_tid, $cur_tid);
296                 } else {
297                         $$old_tid //= next_tid($self);
298                 }
299         } elsif ($n < 0) { # ghost
300                 $$old_tid //= $cur_valid ? $cur_tid : next_tid($self);
301                 link_refs($self, $refs, $$old_tid);
302                 delete_by_num($self, $n);
303                 $$v++;
304         }
305         1;
306 }
307
308 sub add_over {
309         my ($self, $smsg, $mids, $refs, $xpath, $ddd) = @_;
310         my $old_tid;
311         my $vivified = 0;
312         my $num = $smsg->{num};
313
314         begin_lazy($self);
315         delete_by_num($self, $num, \$old_tid);
316         $old_tid = undef if ($old_tid // 0) <= $self->{min_tid};
317         foreach my $mid (@$mids) {
318                 my $v = 0;
319                 each_by_mid($self, $mid, ['tid'], \&_add_over,
320                                 $mid, $refs, \$old_tid, \$v);
321                 $v > 1 and warn "BUG: vivified multiple ($v) ghosts for $mid\n";
322                 $vivified += $v;
323         }
324         $smsg->{tid} = $vivified ? $old_tid : link_refs($self, $refs, $old_tid);
325         $smsg->{sid} = sid($self, $xpath);
326         my $dbh = $self->{dbh};
327         my $sth = $dbh->prepare_cached(<<'');
328 INSERT INTO over (num, tid, sid, ts, ds, ddd)
329 VALUES (?,?,?,?,?,?)
330
331         my $nc = 1;
332         $sth->bind_param($nc, $num);
333         $sth->bind_param(++$nc, $smsg->{$_}) for (qw(tid sid ts ds));
334         $sth->bind_param(++$nc, $ddd, SQL_BLOB);
335         $sth->execute;
336         $sth = $dbh->prepare_cached(<<'');
337 INSERT INTO id2num (id, num) VALUES (?,?)
338
339         foreach my $mid (@$mids) {
340                 my $id = mid2id($self, $mid);
341                 $sth->execute($id, $num);
342         }
343 }
344
345 sub _remove_oid {
346         my ($self, $smsg, $oid, $removed) = @_;
347         if (!defined($oid) || $smsg->{blob} eq $oid) {
348                 delete_by_num($self, $smsg->{num});
349                 push @$removed, $smsg->{num};
350         }
351         1;
352 }
353
354 # returns number of removed messages in scalar context,
355 # array of removed article numbers in array context.
356 # $oid may be undef to match only on $mid
357 sub remove_oid {
358         my ($self, $oid, $mid) = @_;
359         my $removed = [];
360         begin_lazy($self);
361         each_by_mid($self, $mid, ['ddd'], \&_remove_oid, $oid, $removed);
362         @$removed;
363 }
364
365 sub _num_mid0_for_oid {
366         my ($self, $smsg, $oid, $res) = @_;
367         my $blob = $smsg->{blob};
368         return 1 if (!defined($blob) || $blob ne $oid); # continue;
369         @$res = ($smsg->{num}, $smsg->{mid});
370         0; # done
371 }
372
373 sub num_mid0_for_oid {
374         my ($self, $oid, $mid) = @_;
375         my $res = [];
376         begin_lazy($self);
377         each_by_mid($self, $mid, ['ddd'], \&_num_mid0_for_oid, $oid, $res);
378         @$res, # ($num, $mid0);
379 }
380
381 sub create_tables {
382         my ($dbh) = @_;
383
384         $dbh->do(<<'');
385 CREATE TABLE IF NOT EXISTS over (
386         num INTEGER NOT NULL, /* NNTP article number == IMAP UID */
387         tid INTEGER NOT NULL, /* THREADID (IMAP REFERENCES threading, JMAP) */
388         sid INTEGER, /* Subject ID (IMAP ORDEREDSUBJECT "threading") */
389         ts INTEGER, /* IMAP INTERNALDATE (Received: header, git commit time) */
390         ds INTEGER, /* RFC-2822 sent Date: header, git author time */
391         ddd VARBINARY, /* doc-data-deflated (->to_doc_data, ->load_from_data) */
392         UNIQUE (num)
393 )
394
395         $dbh->do('CREATE INDEX IF NOT EXISTS idx_tid ON over (tid)');
396         $dbh->do('CREATE INDEX IF NOT EXISTS idx_sid ON over (sid)');
397         $dbh->do('CREATE INDEX IF NOT EXISTS idx_ts ON over (ts)');
398         $dbh->do('CREATE INDEX IF NOT EXISTS idx_ds ON over (ds)');
399
400         $dbh->do(<<'');
401 CREATE TABLE IF NOT EXISTS counter (
402         key VARCHAR(8) PRIMARY KEY NOT NULL,
403         val INTEGER DEFAULT 0,
404         UNIQUE (key)
405 )
406
407         $dbh->do("INSERT OR IGNORE INTO counter (key) VALUES ('thread')");
408         $dbh->do("INSERT OR IGNORE INTO counter (key) VALUES ('ghost')");
409
410         $dbh->do(<<'');
411 CREATE TABLE IF NOT EXISTS subject (
412         sid INTEGER PRIMARY KEY AUTOINCREMENT,
413         path VARCHAR(40) NOT NULL, /* SHA-1 of normalized subject */
414         UNIQUE (path)
415 )
416
417         $dbh->do(<<'');
418 CREATE TABLE IF NOT EXISTS id2num (
419         id INTEGER NOT NULL, /* <=> msgid.id */
420         num INTEGER NOT NULL,
421         UNIQUE (id, num)
422 )
423
424         # performance critical:
425         $dbh->do('CREATE INDEX IF NOT EXISTS idx_inum ON id2num (num)');
426         $dbh->do('CREATE INDEX IF NOT EXISTS idx_id ON id2num (id)');
427
428         $dbh->do(<<'');
429 CREATE TABLE IF NOT EXISTS msgid (
430         id INTEGER PRIMARY KEY AUTOINCREMENT, /* <=> id2num.id */
431         mid VARCHAR(244) NOT NULL,
432         UNIQUE (mid)
433 )
434
435 }
436
437 sub commit_lazy {
438         my ($self) = @_;
439         delete $self->{txn} or return;
440         $self->{dbh}->commit;
441 }
442
443 sub begin_lazy {
444         my ($self) = @_;
445         return if $self->{txn};
446         my $dbh = $self->dbh or return;
447         $dbh->begin_work;
448         # $dbh->{Profile} = 2;
449         $self->{txn} = 1;
450 }
451
452 sub rollback_lazy {
453         my ($self) = @_;
454         delete $self->{txn} or return;
455         $self->{dbh}->rollback;
456 }
457
458 sub dbh_close {
459         my ($self) = @_;
460         die "in transaction" if $self->{txn};
461         $self->SUPER::dbh_close;
462 }
463
464 sub create {
465         my ($self) = @_;
466         unless (-r $self->{filename}) {
467                 require File::Path;
468                 require File::Basename;
469                 File::Path::mkpath(File::Basename::dirname($self->{filename}));
470         }
471         # create the DB:
472         PublicInbox::Over::dbh($self);
473         $self->dbh_close;
474 }
475
476 sub rethread_prepare {
477         my ($self, $opt) = @_;
478         return unless $opt->{rethread};
479         begin_lazy($self);
480         my $min = $self->{min_tid} = get_counter($self->{dbh}, 'thread') // 0;
481         my $pr = $opt->{-progress};
482         $pr->("rethread min THREADID ".($min + 1)."\n") if $pr && $min;
483 }
484
485 sub rethread_done {
486         my ($self, $opt) = @_;
487         return unless $opt->{rethread} && $self->{txn};
488         defined(my $min = $self->{min_tid}) or croak('BUG: no min_tid');
489         my $dbh = $self->{dbh} or croak('BUG: no dbh');
490         my $rows = $dbh->selectall_arrayref(<<'', { Slice => {} }, $min);
491 SELECT num,tid FROM over WHERE num < 0 AND tid < ?
492
493         my $show_id = $dbh->prepare('SELECT id FROM id2num WHERE num = ?');
494         my $show_mid = $dbh->prepare('SELECT mid FROM msgid WHERE id = ?');
495         my $pr = $opt->{-progress};
496         my $total = 0;
497         for my $r (@$rows) {
498                 my $exp = 0;
499                 $show_id->execute($r->{num});
500                 while (defined(my $id = $show_id->fetchrow_array)) {
501                         ++$exp;
502                         $show_mid->execute($id);
503                         my $mid = $show_mid->fetchrow_array;
504                         if (!defined($mid)) {
505                                 warn <<EOF;
506 E: ghost NUM=$r->{num} ID=$id THREADID=$r->{tid} has no Message-ID
507 EOF
508                                 next;
509                         }
510                         $pr->(<<EOM) if $pr;
511 I: ghost $r->{num} <$mid> THREADID=$r->{tid} culled
512 EOM
513                 }
514                 delete_by_num($self, $r->{num});
515         }
516         $pr->("I: rethread culled $total ghosts\n") if $pr && $total;
517 }
518
519 # used for cross-inbox search
520 sub eidx_prep ($) {
521         my ($self) = @_;
522         $self->{-eidx_prep} //= do {
523                 my $dbh = $self->dbh;
524                 $dbh->do(<<"");
525 INSERT OR IGNORE INTO counter (key) VALUES ('eidx_docid')
526
527                 $dbh->do(<<'');
528 CREATE TABLE IF NOT EXISTS inboxes (
529         ibx_id INTEGER PRIMARY KEY AUTOINCREMENT,
530         eidx_key VARCHAR(255) NOT NULL, /* {newsgroup} // {inboxdir} */
531         UNIQUE (eidx_key)
532 )
533
534                 $dbh->do(<<'');
535 CREATE TABLE IF NOT EXISTS xref3 (
536         docid INTEGER NOT NULL, /* <=> over.num */
537         ibx_id INTEGER NOT NULL, /* <=> inboxes.ibx_id */
538         xnum INTEGER NOT NULL, /* NNTP article number in ibx */
539         oidbin VARBINARY NOT NULL, /* 20-byte SHA-1 or 32-byte SHA-256 */
540         UNIQUE (docid, ibx_id, xnum, oidbin)
541 )
542
543         $dbh->do('CREATE INDEX IF NOT EXISTS idx_docid ON xref3 (docid)');
544
545                 $dbh->do(<<'');
546 CREATE TABLE IF NOT EXISTS eidx_meta (
547         key VARCHAR(255) PRIMARY KEY,
548         val VARCHAR(255) NOT NULL
549 )
550
551                 $dbh;
552         };
553 }
554
555 sub eidx_meta { # requires transaction
556         my ($self, $key, $val) = @_;
557
558         my $sql = 'SELECT val FROM eidx_meta WHERE key = ? LIMIT 1';
559         my $dbh = $self->{dbh};
560         defined($val) or return $dbh->selectrow_array($sql, undef, $key);
561
562         my $prev = $dbh->selectrow_array($sql, undef, $key);
563         if (defined $prev) {
564                 $sql = 'UPDATE eidx_meta SET val = ? WHERE key = ?';
565                 $dbh->do($sql, undef, $val, $key);
566         } else {
567                 $sql = 'INSERT INTO eidx_meta (key,val) VALUES (?,?)';
568                 $dbh->do($sql, undef, $key, $val);
569         }
570         $prev;
571 }
572
573 sub eidx_max {
574         my ($self) = @_;
575         get_counter($self->{dbh}, 'eidx_docid');
576 }
577
578 sub add_xref3 {
579         my ($self, $docid, $xnum, $oidhex, $eidx_key) = @_;
580         begin_lazy($self);
581         my $ibx_id = id_for($self, 'inboxes', 'ibx_id', eidx_key => $eidx_key);
582         my $oidbin = pack('H*', $oidhex);
583         my $sth = $self->{dbh}->prepare_cached(<<'');
584 INSERT OR IGNORE INTO xref3 (docid, ibx_id, xnum, oidbin) VALUES (?, ?, ?, ?)
585
586         $sth->bind_param(1, $docid);
587         $sth->bind_param(2, $ibx_id);
588         $sth->bind_param(3, $xnum);
589         $sth->bind_param(4, $oidbin, SQL_BLOB);
590         $sth->execute;
591 }
592
593 sub remove_xref3 {
594         my ($self, $docid, $oidhex, $eidx_key) = @_;
595         begin_lazy($self);
596         my $oidbin = pack('H*', $oidhex);
597         my $sth;
598         if (defined $eidx_key) {
599                 my $ibx_id = id_for($self, 'inboxes', 'ibx_id',
600                                         eidx_key => $eidx_key);
601                 $sth = $self->{dbh}->prepare_cached(<<'');
602 DELETE FROM xref3 WHERE docid = ? AND ibx_id = ? AND oidbin = ?
603
604                 $sth->bind_param(1, $docid);
605                 $sth->bind_param(2, $ibx_id);
606                 $sth->bind_param(3, $oidbin, SQL_BLOB);
607         } else {
608                 $sth = $self->{dbh}->prepare_cached(<<'');
609 DELETE FROM xref3 WHERE docid = ? AND oidbin = ?
610
611                 $sth->bind_param(1, $docid);
612                 $sth->bind_param(2, $oidbin, SQL_BLOB);
613         }
614         $sth->execute;
615 }
616
617 # for when an xref3 goes missing, this does NOT update {ts}
618 sub update_blob {
619         my ($self, $smsg, $oidhex) = @_;
620         my $sth = $self->{dbh}->prepare(<<'');
621 UPDATE over SET ddd = ? WHERE num = ?
622
623         $smsg->{blob} = $oidhex;
624         $sth->bind_param(1, ddd_for($smsg), SQL_BLOB);
625         $sth->bind_param(2, $smsg->{num});
626         $sth->execute;
627 }
628
629 1;