473,394 Members | 1,761 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,394 software developers and data experts.

A few general mysql questions

170 100+
Hello all,

Could someone provide answers to the following please?

1)Once I’ve added indexes to a table, do I have to optimize the table?
2) As far as searching, Is it better to have one record with 100 columns or 10 records with 10 cols to represent the same data? What about updating?
3) Does it make a difference which order mysql searches for column names? Is it quicker if you write the select col1,col2,col3 in their correct order or not?
4) If you just want to know how many records are returned from a select query, is it necessary to run the full query and then get mysql_numrows, or is there a quicker way?

Thankyou for any answers to these.
Jun 2 '08 #1
3 1341
r035198x
13,262 8TB
Hello all,

Could someone provide answers to the following please?

1)Once I’ve added indexes to a table, do I have to optimize the table?
2) As far as searching, Is it better to have one record with 100 columns or 10 records with 10 cols to represent the same data? What about updating?
3) Does it make a difference which order mysql searches for column names? Is it quicker if you write the select col1,col2,col3 in their correct order or not?
4) If you just want to know how many records are returned from a select query, is it necessary to run the full query and then get mysql_numrows, or is there a quicker way?

Thankyou for any answers to these.
Here is a good read for that.
Jun 3 '08 #2
beary
170 100+
Here is a good read for that.
Um, thanks r035198x. This link addressed the 1st of my questions to a degree. Most of the page was user comments. In case I'm missing something, were the answers to the other questions also on that page?
Jun 4 '08 #3
r035198x
13,262 8TB
2) As far as searching, Is it better to have one record with 100 columns or 10 records with 10 cols to represent the same data? What about updating?
All things even , one table should be faster becuase there is no joining required. However, deciding whether or not to break a table into smaller tables should be done through normalization.

3) Does it make a difference which order mysql searches for column names? Is it quicker if you write the select col1,col2,col3 in their correct order or not?
No that has nothing to do with search speeds. The only important thing about that order is that it is the order in which the results are returned.

4) If you just want to know how many records are returned from a select query, is it necessary to run the full query and then get mysql_numrows, or is there a quicker way?
Expand|Select|Wrap|Line Numbers
  1. select count(*) from tableName
Jun 4 '08 #4

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

Similar topics

4
by: Chris | last post by:
Hi, sorry to post OT but i cant find the MySQL newsgroup, however i am hoping to pick up on some expert advice from php/mysql gurus here. I'm having some trouble performing a delete across two...
175
by: Sai Hertz And Control Systems | last post by:
Dear all, Their was a huge rore about MySQL recently for something in java functions now theirs one more http://www.mysql.com/doc/en/News-5.0.x.html Does this concern anyone. What I...
1
by: E.T. Grey | last post by:
Hi All, Despite spending the past six to seven hours perusing the docs on the mySQl site, I still have questions unanswered, and have been unable to get any help. I am familiar with Sybase, some...
1
by: UKuser | last post by:
Hi Guys, I have some wierd MySQL queries. Although I am using ADODB (an abstraction layer) - the queries will probably be quite general. 1) When I post data in a url (i.e. post.php?id=120) and...
2
by: Brave | last post by:
Hi, I normally work with MS Access databases using ASP pages. I have been given the opprotunity to work on some available SQL server space, and wanted to ask a couple of questions. The following...
1
by: Ozz | last post by:
Hello, I am trying to turn on General logging on mysql server . If I go >mysqld -l filename on shell, it says "command not found". What is the best way to create General log on a live server. ...
0
by: Sam Flywheel | last post by:
Hello, all: I am pleased to announce that the MySQL Journal is moving forward. During the past two weeks, I've been discussing the journal with MySQL AB, and the plan that's been devised...
5
by: Ted | last post by:
I am working on two versions of an application, one of which will be a windows forms application (which will need to be redistributable) and the other will be a web application. I have MS Visual...
10
by: bill | last post by:
I have a database of kennels. One page lists the kennels alphabetically by kennel name. I have a field for kennel name and an index with kennel name as the only field. Some of the kennels have...
27
by: gerrymcc | last post by:
Hello, I'm a php/mysql beginner... Is there any way of making the mysql command line client full-screen? Sometimes it's easier to use the client than go thru php, but since it's only about 80...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.