The Glade 4.0

"Turn the lights down, the party just got wilder."
It is currently Sun Nov 24, 2024 9:47 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Wed Jun 06, 2012 3:32 pm 
Offline
Sensitive Ponytail Guy
User avatar

Joined: Fri Sep 04, 2009 10:18 pm
Posts: 2765
One of the things I've inherited as a consequence of my new position is a rickety old CRM (Customer Relations Management) tool that was cobbled together by designing custom forms and writing macros in Access 2000. Today, my boss said to me: "It's behaving strangely, see if you can fix it".

Specifically, one of the reports will produce results in a pretty timely fashion if asked to query the database for a 1-month period but gets badly hung if asked for results from a 1- or 2-day period.

Anyone have any clue why a report would perform well when the date range is long and poorly when it's short?

_________________
Go back to zero, take a pill, and get well ~ Lemmy Kilmister


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 06, 2012 8:19 pm 
Offline
Not the ranger you're looking for
User avatar

Joined: Wed Sep 02, 2009 7:59 pm
Posts: 321
Location: Here
It might be that when asked for say 3 - 5 June 2012, it's searching for the 3 - 5 time period prior to searching for the month and year.

_________________
"If you haven't got anything nice to say about anybody, come sit next to me." - Alice R. Longworth

"Good? Bad? I'm the guy with the gun." - Ash Williams


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Jun 06, 2012 9:23 pm 
Offline
The Dancing Cat
User avatar

Joined: Wed Nov 04, 2009 2:21 pm
Posts: 9354
Location: Ohio
I am going to bank on Access crazy poor architecture and imho very bad sql support. Less than helpful I know, but if you can post the query source code we could poke at it.

_________________
Quote:
In comic strips the person on the left always speaks first. - George Carlin


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jun 07, 2012 12:17 pm 
Offline
User avatar

Joined: Wed Feb 03, 2010 8:20 am
Posts: 1037
Where's the data? In Access, or in an external database?

Like Mr. Hopwin suggested though, it'd be easier if you have a code snippet, even a genericized one.

_________________
Image Image Image Image Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jun 07, 2012 3:45 pm 
Offline
Sensitive Ponytail Guy
User avatar

Joined: Fri Sep 04, 2009 10:18 pm
Posts: 2765
Update - this should teach me never to trust the user, even when the user is my boss and the only other developer on the program in question.

Turns out the problem isn't that queries for long timeframes run just fine while short timeframes bog the system down. The problem occurs when the user selects the option that adds the following to the query:
"AND table1.date = table2.date"

When the user selects that option, the query is forced to cross-check values between 2 very large tables. One table has over 2 million entries while the other has over 6 million. We could easily remedy the problem by deleting everything prior to 2011, but the powers that be refuse to allow this.

The only solution appears to be loading records that occur within the requested date range into temp tables and then using the temp tables for the fine-tuning query, but it's sloppy as hell and neither I nor my boss like it.

_________________
Go back to zero, take a pill, and get well ~ Lemmy Kilmister


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Jun 08, 2012 6:55 am 
Offline
User avatar

Joined: Wed Feb 03, 2010 8:20 am
Posts: 1037
Depending on where the tables live, you could look at proper indexing.

You could compromise with the "powers that be" and archive the old records out to a new table, if they need to stay around for compliance reasons or something.

_________________
Image Image Image Image Image


Top
 Profile  
Reply with quote  
 Post subject: Re:
PostPosted: Fri Jun 08, 2012 11:05 am 
Offline
The Dancing Cat
User avatar

Joined: Wed Nov 04, 2009 2:21 pm
Posts: 9354
Location: Ohio
Vladimirr wrote:
You could compromise with the "powers that be" and archive the old records out to a new table, if they need to stay around for compliance reasons or something.

^ That

_________________
Quote:
In comic strips the person on the left always speaks first. - George Carlin


Top
 Profile  
Reply with quote  
 Post subject: Re: Re:
PostPosted: Sat Jun 09, 2012 8:06 am 
Offline
Sensitive Ponytail Guy
User avatar

Joined: Fri Sep 04, 2009 10:18 pm
Posts: 2765
Hopwin wrote:
Vladimirr wrote:
You could compromise with the "powers that be" and archive the old records out to a new table, if they need to stay around for compliance reasons or something.
^ That
I suggested it, and was told that it's already been suggested and rejected. The problem, as my boss explained it to me, is that this program and the database were developed by a rival company that we acquired last year. The powers that be are afraid to do anything to the data because they don't understand exactly what it is and they don't want to run the risk of violating any compliance laws.

Sometime in the next year or so, this entire thing is going to be ported to a web-based solution, and the fees that will be paid for the porting and subsequent storage of all this data promise to be daunting, but even that fact hasn't caused the higher-ups to re-think their position. So, we (my boss and I) just have to live with it until it's not our problem anymore.

_________________
Go back to zero, take a pill, and get well ~ Lemmy Kilmister


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 131 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group