bio | home | mobile | papers | videos



ev(7)                  Miscellaneous Information Manual                  ev(7)



NAME
       ev - PQ IRDB database system

DESCRIPTION
       Ev is a simple database system used for pq(1) Implicit Relational Data-
       base (IRDB) directory queries.  An ev database consists of a data file,
       a  proto  file  describing  the  contents of the data file and optional
       index files for efficient database queries.  The arguments to  ev  pro-
       vide  the data and proto file names, the directory containing the index
       files, and the database separator.  See modules(7).

       An ev data file is a Unicode file composed of newline-terminated lines.
       Each  line  in  the data file represents a database record and contains
       delimited, variable-length fields denoting database attributes.

       Information describing the database attributes is  stored  in  a  proto
       file and used to create the index files and to resolve runtime queries.
       Lines in the proto file are newline terminated and have  the  following
       tab- or space-separated fields:

       attribute name      Name  of  attribute in the database.  Cannot be the
                           string attribute or contain the equal sign  charac-
                           ter (=).  Must be less than 15 characters.

       attribute address  Position  of  the  attribute  in  the  data  file.
                           Attributes are counted left to right starting  with
                           field 1 and are separated by a character delimiter.
                           See modules(7).

       primary length      Length (in bytes) of entries in the  primary  index
                           file.  For attributes that use the numeric matching
                           algorithm, the attribute length must be at least as
                           large as the longest value.  If index files are not
                           used, this is set to a period (.).

       secondary length    Length (in bytes) of entries in the secondary index
                           file.  For attributes that use the numeric matching
                           algorithm, the attribute length must be at least as
                           large as the longest value.  If index files are not
                           used, this is set to a period (.).

       match               The match flag is a single  character  representing
                           the  matching  algorithm used for this attribute in
                           database queries.  The possible values  are  listed
                           below  under  Match  Type.   The  match flag may be
                           accompanied by zero or more of the Value Character-
                           istics  also listed below.  The order of these one-
                           character flags is not significant.

       multiple            Contains either a period (.), m, or m=x.   Value  m
                           denotes  a multiple field.  Value m=x signifies the
                           database attribute used to distinguish between  the
                           main line in the data file (attribute=x) and auxil-
                           iary ones (attribute!=x).  There can be at most one
                           attribute with value m=x per proto file.

       default index       Index  files  are  create  by  pqgen(1M)  for those
                           attributes with default  index  flag  equal  to  i.
                           Attributes with default index equal to a period (.)
                           can also be used to query  the  database  but  with
                           worse  performance.  Attributes used frequently for
                           database queries should be indexed.

   Match Type
       e      Exact match.
       n      Numeric match.
       p      Prefix match.
       s      Exact match unless argument ends with a star (*), in which  case
              prefix match.

   Value Characteristics
       a      Ignore non-alphanumerics.
       i      Ignore case.
       m      Multiple  entry  match.  If argument is empty, 1 or 2, retrieve
              first, second or third record for query, respectively.

       The order of the attributes as they appear in the proto file is signif-
       icant.  For database queries with two or more qualifiers, the attribute
       that appears first in the proto file is used to perform the  search  of
       the database.  Attributes with index files are preferred.

       Index  files,  created  by  pqgen(1)  using  the  data and proto files,
       improve performance of database queries.  Index files are arranged in a
       multiway  tree  format  to  improve performance and limit the amount of
       core memory needed.

       The C interface to ev can be seen in pq(2).

FILES
       /lib/pq/dispatch              default pq configuration file
       /sys/src/cmd/pq/example/dispatch
                                     sample dispatch file

SEE ALSO
       pq(1), pqgen(1), pq(2), modules(7).



                                                                         ev(7)