Click here to Skip to main content
15,907,874 members
Home / Discussions / Database
   

Database

 
AnswerRe: Cursor issue Pin
Ashfield4-Dec-09 1:20
Ashfield4-Dec-09 1:20 
GeneralRe: Cursor issue Pin
AndyInUK4-Dec-09 1:28
AndyInUK4-Dec-09 1:28 
GeneralRe: Cursor issue Pin
Ashfield4-Dec-09 2:16
Ashfield4-Dec-09 2:16 
AnswerRe: Cursor issue Pin
Bassam Saoud4-Dec-09 10:41
Bassam Saoud4-Dec-09 10:41 
GeneralRe: Cursor issue Pin
Shameel4-Dec-09 23:42
professionalShameel4-Dec-09 23:42 
AnswerRe: Cursor issue Pin
RyanEK6-Dec-09 13:18
RyanEK6-Dec-09 13:18 
AnswerRe: Cursor issue [modified] Pin
Niladri_Biswas7-Dec-09 21:59
Niladri_Biswas7-Dec-09 21:59 
QuestionPerformance tip on multiple selects to retrieve alot of BLOBS? Pin
Thomas ST3-Dec-09 22:28
Thomas ST3-Dec-09 22:28 
I am retrieving a lot of data and want this to be as fast as possible.
Let's say I have a database with two tables; tablePerson and tableFiles. A person has one file wich is stored in a BLOB. In my solution as it is now, I select * from person table, and while reading from this I select one row from the table with the blob.. This sums up to alot of one-row-queries towards the blob-table.. This blob-table has 678000 rows, and all these queries are taking a lot of time...

So.. How can I improve performance on this? Any tips?

This is something similar to my code:
using(SqlCommand cmd = new SqlCommand("select * from tablePerson", _conn)
{
  SqlDataReader r = cmd.exeCuteReader();

  while(r.read())
  {
    Person p = new Person();
    //read some data from columns..
    
    string documentID = Convert.ToString(r["p_docid"]);
    p.LocationToDocument = ExtractDocument(documentID);
  }
  r.close();
  r.dispose();
}

...

private string ExtractDocument(string docid)
{
   string filename = "";
   using (SqlCommand cmd = new SqlCommand("select d_docid, d_title, d_BLOB from tableDocument where d_docid=@paramDocID", _conn)
   {
      SqpParameter p = new SqlParameter("@paramDocID", System.Data.SqlDbType.Text);
      p.Value = docid;

      SqlDataReader r = cmd.exeCuteReader(System.Data.CommandBehavior.SequentialAccess);

      while(r.read()) //1 row..
      {
          //extract blob to a file, and set filename=that document..
      }
   }
   return filename;
}

AnswerRe: Performance tip on multiple selects to retrieve alot of BLOBS? Pin
Ashfield4-Dec-09 1:27
Ashfield4-Dec-09 1:27 
AnswerRe: Performance tip on multiple selects to retrieve alot of BLOBS? Pin
Bassam Saoud4-Dec-09 10:44
Bassam Saoud4-Dec-09 10:44 
QuestionAdding an Identity Later T-SQL Pin
Vimalsoft(Pty) Ltd3-Dec-09 21:17
professionalVimalsoft(Pty) Ltd3-Dec-09 21:17 
AnswerRe: Adding an Identity Later T-SQL Pin
Mycroft Holmes3-Dec-09 22:11
professionalMycroft Holmes3-Dec-09 22:11 
GeneralRe: Adding an Identity Later T-SQL Pin
Vimalsoft(Pty) Ltd4-Dec-09 0:49
professionalVimalsoft(Pty) Ltd4-Dec-09 0:49 
QuestionGeneral question on DB normalization Pin
Dewald3-Dec-09 20:59
Dewald3-Dec-09 20:59 
AnswerRe: General question on DB normalization Pin
Mycroft Holmes3-Dec-09 22:17
professionalMycroft Holmes3-Dec-09 22:17 
GeneralRe: General question on DB normalization Pin
Dewald3-Dec-09 22:44
Dewald3-Dec-09 22:44 
GeneralRe: General question on DB normalization Pin
Mycroft Holmes3-Dec-09 22:56
professionalMycroft Holmes3-Dec-09 22:56 
AnswerRe: General question on DB normalization Pin
i.j.russell4-Dec-09 1:19
i.j.russell4-Dec-09 1:19 
AnswerRe: General question on DB normalization Pin
Eddy Vluggen4-Dec-09 3:01
professionalEddy Vluggen4-Dec-09 3:01 
GeneralRe: General question on DB normalization Pin
Dewald4-Dec-09 3:07
Dewald4-Dec-09 3:07 
AnswerDB Normalization - Further reading Pin
David Mujica4-Dec-09 3:37
David Mujica4-Dec-09 3:37 
Question[Message Deleted] Pin
Uma J3-Dec-09 20:24
Uma J3-Dec-09 20:24 
AnswerRe: Exporting data from stored procedure to excel spreadsheets Pin
dan!sh 3-Dec-09 20:46
professional dan!sh 3-Dec-09 20:46 
QuestionExport records to excel from sql Pin
padmanabhan N3-Dec-09 19:17
padmanabhan N3-Dec-09 19:17 
AnswerRe: Export records to excel from sql Pin
T21023-Dec-09 19:29
T21023-Dec-09 19:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.