• Post Reply Bookmark Topic Watch Topic
  • New Topic

Establishing Connections with a database

 
Saeed Mirkhan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have a general question about dealing with databases.

I'm working on an IR system, and in the parsing phase we need to store words from one document into the database. Is it better to open a connection for storing each word, or maybe I should open a connection at the document level,taking into consideration the database security issue.

Thank you.
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Estimate the number of words in your document. Use a rough estimate of the time to open and close a connection. Multiply the two numbers, and you'll have the overhead of getting connections on a per-word basis. Probably won't take very many words before you'll find the overhead to be excessive.
 
Skool. Stay in. Smartness. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!