Heavy Lift Paging



  • So I have the joy of working on this web app I inherited from a developer who has been "transitioned" to another role.Visually and functionally it seems to work ok, its just a bit....slow.

    This week I finally was able to address one of the many slow parts of the app. A simple datagrid showing 25 records with a paging function.

    Now most developers would work out a sort order and paging system to get the 25 records currently being displayed, great developers would even cache those records for a few minutes in case the user paged back. Unfortunately for me the previous guy decided to use caching with server side paging. How did he do this. Well when the user first loaded the screen he pulled "ALL" records for that user from the database and cached them on the webserver, once the caching was complete the pager would pull from the cache until the user logged out.

    In theory it does not sound too bad until you factor in these key points he forgot about (or never bothered to consider).

    1. In our system some users (read all) can have several "hundred thousand" records in the database even after filtering down.
    2. The session timeout is set for 2 hours (previously he had it set for 2 days) and I cannot lower it more for political reasons (love when office politics set tech requirements).
    3. He never put any limit on the number of records returned from the database in the sql.

    Can anyone else see why that screen might be slow to load, or why the server runs low on memory when more than a couple users were online?

    While I have this grid ticked off my list I have another dozen of so built using the same pattern.



  • @codefanatic said:

    While I have this grid ticked off my list I have another dozen of so built using the same pattern.

    Hopefully you were able to generalize the solution for this grid, to make refactoring the others easier.



  • Fortunately yes, unfortunately every time I open up one of these components I normally find other "issues" that I also have to address. The biggest problem though is that all the grids use this weird global session structure and plugin system which ties into the filtering and authentication controls across the application, even though 99% of the filtering options are unique to a given grid. At least I convinced management that fixing the existing problems is more important than adding new features.



  • @codefanatic said:

    In our system some users (read all) can have several "hundred thousand" records in the database even after filtering down.
    Why is hundred thousand in quotes?



  • @codefanatic said:

    At least I convinced management that fixing the existing problems is more important than adding new features.

    Ha, caught in your own web of lies!! Your story almost sounded plausible until this part; now we know you are making it all up!



  • @morbiuswilters said:

    @codefanatic said:
    At least I convinced management that fixing the existing problems is more important than adding new features.

    Ha, caught in your own web of lies!! Your story almost sounded plausible until this part; now we know you are making it all up!

     No I swear its the truth...now im not saying that the 100+ irate customers that called up the last time the system went into meltdown didnt have something to do with it. Just a happy co-incidence.

    Of course it will probably only last for a few days until everything settles down, but I'll take what I can get.



  • @Sutherlands said:

    @codefanatic said:
    In our system some users (read all) can have several "hundred thousand" records in the database even after filtering down.
    Why is hundred thousand in quotes?

    My bad I forgot to mention that when I confronted the dev about why he
    allowed an unlimited number of records he stated that any user would
    have at most a few hundred records, and i replied back that yes they would have a few hundred...a few hundred thousand.



  • @Sutherlands said:

    @codefanatic said:
    In our system some users (read all) can have several "hundred thousand" records in the database even after filtering down.
    Why is hundred thousand in quotes?
     

    A devout believer in the “blog” of “unnecessary” quotation marks, I imagine.



  • @snover said:

    @Sutherlands said:

    @codefanatic said:
    In our system some users (read all) can have several "hundred thousand" records in the database even after filtering down.
    Why is hundred thousand in quotes?
     

    A devout believer in the “blog” of “unnecessary” quotation marks, I imagine.

     

    most of it actually looks to me like an attempt at emphasis, where i tend to use asterisks.

     



  • @SEMI-HYBRID code said:

    most of it actually looks to me like an attempt at emphasis, where i tend to use asterisks.

    I thought asterisks denoted actions. shrugs



  • @SEMI-HYBRID code said:

    most of it actually looks to me like an attempt at emphasis, where i tend to use asterisks.
     

    That does "appear" to be the case.

     

    I assume this practice comes from the same dubious source as double-spacing after a sentence.



  • @Sutherlands said:

    @codefanatic said:
    In our system some users (read all) can have several "hundred thousand" records in the database even after filtering down.
    Why is hundred thousand in quotes?
     

    By "a hundred thousand", he means "yo momma".



  • @dhromed said:

    @SEMI-HYBRID code said:

    most of it actually looks to me like an attempt at emphasis, where i tend to use asterisks.
     

    That does "appear" to be the case.

     

    I assume this practice comes from the same dubious source as double-spacing after a sentence.

    *"typewriters"?*


  • @dhromed said:

    @SEMI-HYBRID code said:

    most of it actually looks to me like an attempt at emphasis, where i tend to use asterisks.
     

    That does "appear" to be the case.

     

    I assume this practice comes from the same dubious source as double-spacing after a sentence.


    As said elsewhere, two spaces after a sentence is indeed from the days of monospace (i.e. typewriting), to make the end of a sentence visually clearer. In texts produced by typesetting/printing, the varying letter widths make it unnecessary to have the double space (though I still prefer the double space myself), and this has carried forward into word processors. Asterisks surrounding a word or phrase were used by some typewritists, though underscores were more usual (backspace, then overtype with underscores). The real origin of the asterisk thing is programs like MS Word and MS Outlook, which can be set up so that surrounding asterisks mean 'render as bold text,' surrounding underscores mean 'render as italic' (or 'render as underlined:' depends on the program). If you have MS Word handy, look in Options, Auto Correct, AutoFormat As You Type, and you'll see the checkbox for this.


  • Discourse touched me in a no-no place

    @Cad Delworth said:

    surrounding underscores mean 'render as italic'
    I thought solidi were used for that?



  • @Cad Delworth said:

    The real origin of the asterisk thing is programs like MS Word and MS Outlook, which can be set up so that surrounding asterisks mean 'render as bold text,' surrounding underscores mean 'render as italic' (or 'render as underlined:' depends on the program). If you have MS Word handy, look in Options, Auto Correct, AutoFormat As You Type, and you'll see the checkbox for this.

    Actually, no, emphasis /italics/ and underline like that comes from the early, ASCII-only email and Usenet. (And Fidonet and BBSes, I guess.)



  • @Cad Delworth said:

    As said elsewhere,
     




  • @Sutherlands said:

    @dhromed said:

    @SEMI-HYBRID code said:

    most of it actually looks to me like an attempt at emphasis, where i tend to use asterisks.
     

    That does "appear" to be the case.

     

    I assume this practice comes from the same dubious source as double-spacing after a sentence.

    *"typewriters"?*
    i'm a bit younger, i learned that from dialogues in Planescape: Torment. (Do you *know* Dak'kon?)


  • @frits said:

    @SEMI-HYBRID code said:

    most of it actually looks to me like an attempt at emphasis, where i tend to use asterisks.

    I thought asterisks denoted actions. shrugs

    raises eyebrows i thought human beings are quite familiar with the concept of context-sensitive meaning of symbols.



  • @SEMI-HYBRID code said:

    raises eyebrows i thought human beings are quite familiar with the concept of context-sensitive meaning of symbols.

    What gave you the impression you were communicating with human beings.



  • I've begun to use dashes myself. You -know- about them right?



  • @erikal said:

    I've begun to use dashes myself. You -know- about them right?

    I've started nailing down my characters with backslashes to prevent them from \escaping



  • @boomzilla said:

    @SEMI-HYBRID code said:
    raises eyebrows i thought human beings are quite familiar with the concept of context-sensitive meaning of symbols.

    What gave you the impression you were communicating with human beings.

     

    the sense of humour here often seems to be too elaborate and stingy to be a product of an algo... wait... GlaDOS? Is that you?



  • @boomzilla said:

    @SEMI-HYBRID code said:
    raises eyebrows i thought human beings are quite familiar with the concept of context-sensitive meaning of symbols.
    What gave you the impression you were communicating with human beings.

    Most human beings are not cognizant when begging the question.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.