Database question.....

Discussion in 'Python' started by John D., Aug 7, 2003.

  1. John D.

    John D. Guest

    I have a small (fewer than a few thousand records) database with the
    following properties:

    Each record has four fields: A, B, C, D.
    Fields A and B are unique:
    there is one B for every A and one A for every B.
    Fields C and D are not unique.
    Sometimes I need to use A as the key, other times B is the key:
    I use A to return B, C, D and also B to return A, C, D.
    The items may all be represented as short ASCII strings.

    Currently I am storing this in a 100KB file and converting this to two
    dictionaries. I am reading and writing the entire file to update single
    records, which is inefficient. I am thinking about using anydbm, but then
    how do I do the two-way dictionary lookup? Would I have to store the whole
    database twice? What if I had ten items, would I have to store it ten
    times? Is this what a relational database allows?

    John
    John D., Aug 7, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luis Esteban Valencia
    Replies:
    1
    Views:
    1,383
    Carl Prothman [MVP]
    Jan 12, 2005
  2. =?Utf-8?B?U1M=?=
    Replies:
    3
    Views:
    3,831
    Juan T. Llibre
    May 15, 2005
  3. Replies:
    8
    Views:
    461
  4. casper
    Replies:
    0
    Views:
    9,051
    casper
    Apr 24, 2006
  5. Keith
    Replies:
    1
    Views:
    2,323
    Keith
    Jul 3, 2006
Loading...

Share This Page