473,387 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to Maintain and Optimize SQL Queries with Large Tables?

37
Hi, I have a table called products which consist of various supplier
products and has the following fields:

ID int not null primary key auto_increment
SupplierID int not null
ProductCode varchar(30) not null
productName varchar(255) null
Length varchar(20) null
Width varchar(20) null
Height varchar(20) null
Weight varchar(20) null


The table will be frequently searched online using the following fields using the LIKE where clause: productCode, ProductName, length, width, height, weight

The table will frequently be updated with supplier products.

Up to 300 suppliers are anticipated.

Each supplier may have a product catalogue consisiting of 5000 to 10,000 products.

A supplier can update their catalogue by adding, deleting products to the above table or delete the entire catalogue and insert a new catalogue in which case all the products supplied by the supplier will be deleted (This could be 10,000 records) and then insert a different set of 10,000 products.

As you can see the table will be very large approx 1 million records and needs to be optimized for fast SQL queries whilst maintainig a balance to compensate for the frequent updates i.e large table inserts and deletes.

Now my questions to acheive the above functionality:

1. Which fields should i Index?

2. if I Index the fields on which the SQL query will take place
how long will it take mySQL to re-index those fields with the frequent updates that I require?

3. Is there a more efficient way to achieve the above functionality?

4. Should I be aware of other issues for maintianing this table and running the SQL search query?

Your help and advice will be much appreciated
Feb 23 '07 #1
1 2844
ronverdonk
4,258 Expert 4TB
This is a duplicate thread of http://www.thescripts.com/forum/thread605775.html , which was also posted by you. Since this thread is more detailed, I will remove the older thread from this forum.

moderator
Feb 23 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: StinkFinger | last post by:
All, I am in the process of tweaking and tuning my PHP scripts, and am starting to look in tweaking my indexes in my MySQL tables. I have found many, many articles on the topic and have applied...
4
by: mjuricek | last post by:
I'm having some problems to optimize my stored procedure (select statement with joins) What I'm trying to do is calculate total work. My situation: I have 3 tables I'm using -Input (char...
4
by: dschl | last post by:
Hi, I'm converting an Access 2000 database to Sql Server and must be missing something obvious. Using the Import utility in Sql Server, the Access queries seem to get executed and the...
1
by: Good Man | last post by:
Hi there I've noticed some very weird things happening with my current MySQL setup on my XP Laptop, a development machine. For a while, I have been trying to get the MySQL cache to work....
0
by: Christoph Haas | last post by:
Hi, list... I have written an application in Perl some time ago (I was young and needed the money) that parses multiple large text files containing nested data structures and allows the user to...
13
by: Frank Swarbrick | last post by:
IBM has a product for the VSE operating system called the VSAM Redirector. It allows you to use VSAM to access RDBMS tables/views as if they were actual VSAM files. We're doing a comparison right...
2
by: zwasdl | last post by:
Some of my queries take 1 hour to run, can I run other queries in access while waiting on the first query? If so, how can I do it? Thanks a lot, Wei
8
by: Daz | last post by:
Hi everyone. I was faced with the choice of whether my problem is indeed a PHP problem or a MySQL. I have decided it's a PHP problem as I don't experience the same problem when I execute the...
2
ADezii
by: ADezii | last post by:
Create Indexes on all Columns used in 'ad hoc' Query Joins, restrictions, and sorts (Jet already creates Indexes for Enforced Relationships). Use Primary Keys instead of Unique Indexes wherever...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.