Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Mobile
  4. SQL CE Performance so slow.... [modified]

SQL CE Performance so slow.... [modified]

Scheduled Pinned Locked Moved Mobile
csharpdatabasevisual-studiosql-serversysadmin
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mac24nzmac24nz
    wrote on last edited by
    #1

    Hi. I'm changing an existing C#/Compact framework 2.0 from using DataSets as the data storage (backed up by XML) to SQL Mobile 2005 (as an offline DB only). I'm doing this because after changing each position of the DataSet we were writing the XML to file system (just in case of a crash, low power, etc). That became very slow under Windows Mobile 5 (RAM -> ROM change). So I've just finished rewriting the application so that it used SQL Mobile 2005. When only one entry in the DB changes its a lot faster. Great. But when I delete all data from the DB or I want to insert all records into the DB it takes 1-2 minutes (about 200 entries). This just seems to be way too slow. That means that it can only write about 3 entries per second....that seems really slow. The read performance is very good. I'm using Microsoft SQL Server Mobile Edition 3.0.5206.0 from Visual Studio 2005. The performance is bad when running it inside the debugger and using the same code started directly on the PDA (without the VS 2005 debugger running). I'm not sure how to export my tables as SQL code to code project. Any ideas? or what info can I share which could help anyone (who can help me:) ) Okay, so I ran a test with a Symbol MC70 (Intel XScale 624 Mhz processor). For 158 entries it took over 2 minutes to delete the DB (I delete each DataRow individually - is this why the delete takes so long?). The inserts took quite a while too, about 30 seconds). Why are these values so long? The DB Table has a primary key (4 columns) & the DB Table has a total of 40 columns. Thanks Martin

    modified on Thursday, March 13, 2008 10:48 AM

    M 1 Reply Last reply
    0
    • M mac24nzmac24nz

      Hi. I'm changing an existing C#/Compact framework 2.0 from using DataSets as the data storage (backed up by XML) to SQL Mobile 2005 (as an offline DB only). I'm doing this because after changing each position of the DataSet we were writing the XML to file system (just in case of a crash, low power, etc). That became very slow under Windows Mobile 5 (RAM -> ROM change). So I've just finished rewriting the application so that it used SQL Mobile 2005. When only one entry in the DB changes its a lot faster. Great. But when I delete all data from the DB or I want to insert all records into the DB it takes 1-2 minutes (about 200 entries). This just seems to be way too slow. That means that it can only write about 3 entries per second....that seems really slow. The read performance is very good. I'm using Microsoft SQL Server Mobile Edition 3.0.5206.0 from Visual Studio 2005. The performance is bad when running it inside the debugger and using the same code started directly on the PDA (without the VS 2005 debugger running). I'm not sure how to export my tables as SQL code to code project. Any ideas? or what info can I share which could help anyone (who can help me:) ) Okay, so I ran a test with a Symbol MC70 (Intel XScale 624 Mhz processor). For 158 entries it took over 2 minutes to delete the DB (I delete each DataRow individually - is this why the delete takes so long?). The inserts took quite a while too, about 30 seconds). Why are these values so long? The DB Table has a primary key (4 columns) & the DB Table has a total of 40 columns. Thanks Martin

      modified on Thursday, March 13, 2008 10:48 AM

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      The dirty secret of SQL Server CE performance is that it's best not to use SQL. For simple queries that only affect one table - and INSERT, UPDATE and DELETE only can affect one table - it's better to use a SqlCeResultSet and iterate through it manually. See for example this article[^] on insert performance.

      DoEvents: Generating unexpected recursion since 1991

      M 1 Reply Last reply
      0
      • M Mike Dimmick

        The dirty secret of SQL Server CE performance is that it's best not to use SQL. For simple queries that only affect one table - and INSERT, UPDATE and DELETE only can affect one table - it's better to use a SqlCeResultSet and iterate through it manually. See for example this article[^] on insert performance.

        DoEvents: Generating unexpected recursion since 1991

        M Offline
        M Offline
        mac24nzmac24nz
        wrote on last edited by
        #3

        Hi Mike. Thanks for your answer. I ran into this same article today by chance....and enjoyed what I read. It seems quite annoying that the SQL Server CE team haven't implemented UpdateBatchSize as SQL Anywhere from Sybase has. Still I'll have to live with it.... I guess I'll have a bit of a rewrite to do, so that this works. Still a 10x performance increase would be really great. Thanks Martin

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups