473,468 Members | 1,849 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Database slow down due to query?

I have made some alterations to my company's database so that variable
rates are calculated on postcode area.

This is currently been expanded from a query which featured 12 IIf
statements to one which now features 48 IIf statements. The basis of
the IIf statements are as follows:

1: IIf([Fees]=1500 And [Category]="A" And [PostcodeID]="1",100,0)

So I have 6 different levels of Fees, 2 categories and 4 postcode ID
areas. = 48 IIf statements

Is there a more efficent way to do this?

I had designed a table that included the fields Fees, category,
PostcodeID and premium (with an autonumber PK of premium ID). The
calculation in query then read:

S3: IIf([Fees]=[fee] And [Category]=[Cat] And
[PostcodeID]=[PCArea],[Premium],0)

But this didnt seem to make much of a difference.

I am working here with a database with approx 25,000 records and some v
old machines which run a front end and access the server for a backend.
As you can imagine the system has slowed down considerably since I
introduced this. Its not so much moving from one form to the other that
does the calculations but the running of a report from that form which
displays all the calculations that takes the time (approx 5 mins on
some of the machines!). The system currently has approx 6 concurrent
users (there are more in the office but not all accessing all the time)

Any suggestions would be gratefully received. Current thinking is more
up to date computers?

Cheers

Nov 13 '05 #1
1 1792
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It would help if you described your tables: columns, data types,
relationships w/ other tables; showed the query you are using; and, some
sample data.

Making a table to hold the Fees, Categories, PostCodes & Premiums is a
good idea. You should be able to join to the other table(s) to get the
correct Premiums.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQjXVVoechKqOuFEgEQJaxACbBgzXqkkEkb2nPxfRLKDpVu 4ynlYAnAx8
gAzhIAgNQal1ebEKWzKlx+qF
=0WJG
-----END PGP SIGNATURE-----
dd*****@yahoo.co.uk wrote:
I have made some alterations to my company's database so that variable
rates are calculated on postcode area.

This is currently been expanded from a query which featured 12 IIf
statements to one which now features 48 IIf statements. The basis of
the IIf statements are as follows:

1: IIf([Fees]=1500 And [Category]="A" And [PostcodeID]="1",100,0)

So I have 6 different levels of Fees, 2 categories and 4 postcode ID
areas. = 48 IIf statements

Is there a more efficent way to do this?

I had designed a table that included the fields Fees, category,
PostcodeID and premium (with an autonumber PK of premium ID). The
calculation in query then read:

S3: IIf([Fees]=[fee] And [Category]=[Cat] And
[PostcodeID]=[PCArea],[Premium],0)

But this didnt seem to make much of a difference.

I am working here with a database with approx 25,000 records and some v
old machines which run a front end and access the server for a backend.
As you can imagine the system has slowed down considerably since I
introduced this. Its not so much moving from one form to the other that
does the calculations but the running of a report from that form which
displays all the calculations that takes the time (approx 5 mins on
some of the machines!). The system currently has approx 6 concurrent
users (there are more in the office but not all accessing all the time)

Any suggestions would be gratefully received. Current thinking is more
up to date computers?

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: lkrubner | last post by:
Are there any benchmarks on how much an extra, unneeded VARCHAR, CHAR, INT, BIGINT, TEXT or MEDIUMTEXT slows down a database call with MySql? PostGre info would also be useful. I'm trying to...
2
by: Tim Fountain | last post by:
We've recently enabled slow query logging on a server and it's proving interesting seeing which queries are bogging things down. This one is puzzling me a little: SELECT articleid, type,...
0
by: Chris Back | last post by:
Hi all, We are having a tough time tracking down a problem with my MySQL database. The version is 3.23.58 running as the backend for Request Tracker (rt2) by Best Practical. Occasionally...
7
by: Good Man | last post by:
Hi there I'm in the planning stages of creating a database, and I have two options here. Which makes more sense, and/or provides better performance for queries - a single table with hundreds of...
6
by: Mortrek | last post by:
Hi. We have a .NET programmer using our SQL server. The database is roughly 8GB at this point, full of all of our inventory, payroll data, etc. for running reports. This is on a dual-xeon...
10
by: chris.withers | last post by:
I have built a web portal and was considering adding a 'user mail' feature for users to message each other. I'm a bit uncertain on how to design the DB, so was wondering if there is a standard to...
4
by: Amar | last post by:
Hi All, I need to select data from a database table containing huge amount of data. Now I am storing data using one primary key and I am just using simple select statement, and this process...
9
by: Emin | last post by:
Dear Experts, I have a fairly simple query in which adding a where clause slows things down by at least a factor of 100. The following is the slow version of the query ...
12
by: grace | last post by:
i am wondering why my database retrieval becomes too slow...we set up a new server (ubuntu, breezy badger) machine where we transferred all our files from the old server.. Our new server uses Asus...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.