Welcome, Guest
You have to register before you can post on our site.

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,216
» Latest member: distributorsemen
» Forum threads: 4,029
» Forum posts: 16,404

Full Statistics

Online Users
There are currently 285 online users.
» 0 Member(s) | 283 Guest(s)
Applebot, Bing

Latest Threads
How to install Archboot i...
Forum: Network Problems
Last Post: Meup
2025-05-13, 01:41 PM
» Replies: 0
» Views: 446
clear logs in smoothwall
Forum: Security and Firewalls
Last Post: amanda63
2024-03-10, 03:27 PM
» Replies: 8
» Views: 87,995
I cannot install RedHat 8...
Forum: Redhat
Last Post: hybrid
2023-11-11, 01:01 PM
» Replies: 1
» Views: 41,648
How things are done, usin...
Forum: Xorg Problems
Last Post: ross
2023-09-04, 09:03 AM
» Replies: 0
» Views: 1,888
Im back.....
Forum: Hello
Last Post: anyweb
2021-01-17, 11:36 AM
» Replies: 1
» Views: 5,371
add mp3 plugin to xmms in...
Forum: Fedora
Last Post: anyweb
2021-01-17, 11:30 AM
» Replies: 11
» Views: 41,439
Configuring VSFTPd Server
Forum: FTP Server
Last Post: Johnbaca
2020-10-14, 10:25 AM
» Replies: 32
» Views: 117,576
Wolf won't play sound!
Forum: Game Problems
Last Post: Guest
2020-10-03, 05:51 PM
» Replies: 1
» Views: 55,461
Using git + python
Forum: How Do I?
Last Post: Clueless puppy
2020-08-21, 04:37 PM
» Replies: 0
» Views: 45,464
what does your nick mean ...
Forum: Hello
Last Post: volt
2020-08-06, 03:25 PM
» Replies: 28
» Views: 42,021

 
  importance of a INDEX in mysql
Posted by: hijinks - 2005-03-10, 02:26 PM - Forum: LAMP - No Replies


A lot of people that are getting into PHP are also getting into mysql for the first time. Generally they can build a database and create a good app that works. I have seen a lot of popular scripts that don't use a index on their tables. A index in mysql is kind of like a table of contents in a book. It helps mysql find what its looking for faster.

 

Generally a INDEX should be placed on a column in a table that is going to be searched a lot. So for examle I have made a test table and filled it with random data. I have a column called id which should be unique to each user. So this is a key example of a column that would be used in a where section of a query often. Like this

 

SELECT * FROM test WHERE id=5432;

 

For now we won't limit it since I want to show how fast a index can make a query. So for this example I have a table called test that I have filled with close to 900k rows. Here is a query I'm doing to try to pull a row from a table with no index's.

 



Code:
mysql> select count(*) from test where id=3232301;
+----------+
| count(*) |
+----------+
|        1 |
+----------+
1 row in set (5.97 sec)




 

So that query took almost 6 seconds to run. Just think you created this great forum software and someone that downloaded your forum has a killer forum that has 500k posts. So each time you need to load a page it could take 4 seconds of CPU time per request. Thats A LOT of time. Your server load will shoot through the roof and some people will begin to timeout on their connections.

 

So lets alter this table and set the column id to be a index.

 



Code:
mysql> ALTER TABLE test ADD INDEX(id);
Query OK, 853614 rows affected (48.27 sec)
Records: 853614  Duplicates: 0  Warnings: 0




 

Ok so now lets run our same query as before and see the speed increase;

 



Code:
mysql> select count(*) from test where id=3232301;
+----------+
| count(*) |
+----------+
|        1 |
+----------+
1 row in set (0.07 sec)




 

WOW.. we are WAY below the close to 6 second query time. Now that is fast.. so people if you are created a webapp that uses mysql and expect to have a load of rows in a table USE INDEX's!

 

As a admin I'm sick of fixing people's mistakes cause its their bad database design that's killing server's i work on.

Print this item

  Some questions
Posted by: NeXz - 2005-03-10, 09:20 AM - Forum: How Do I? - Replies (6)


1. How do I can enter the resolv.conf? With su - ? what is the command to read/edit?

 

You must edit resolv.conf to find the linux with a windows XP? And how do I add the linux to a members group like in windows.

 

2. I cant find my second harddrive in linux. I have maked the a partition with Linux format. But I dont find it eny way. I think i have to add something in a file. A command line or something. But dont know what it is :)

 

Thanks for the help peoples :)

Print this item

  Wednesday fun! =)
Posted by: lia - 2005-03-09, 02:25 PM - Forum: Jokes - Replies (2)


No more complaining about the cold or how boring it is to have to scrape your windows in the morning... ;)

<a class="ipsAttachLink ipsAttachLink_image" href="<fileStore.core_Attachment>/post-21-1110377940.png" data-fileid="285">[img]<fileStore.core_Attachment>/post-21-1110377940.png[/img]</a>

<a class="ipsAttachLink ipsAttachLink_image" href="<fileStore.core_Attachment>/post-21-1110377988.png" data-fileid="287">[img]<fileStore.core_Attachment>/post-21-1110377988.png[/img]</a>

<a class="ipsAttachLink ipsAttachLink_image" href="<fileStore.core_Attachment>/post-21-1110378018.png" data-fileid="288">[img]<fileStore.core_Attachment>/post-21-1110378018.png[/img]</a>

<a class="ipsAttachLink ipsAttachLink_image" href="<fileStore.core_Attachment>/post-21-1110378040.png" data-fileid="289">[img]<fileStore.core_Attachment>/post-21-1110378040.png[/img]</a>



Attached Files
.png   Screenshot_1.png (Size: 783.85 KB / Downloads: 257)
.png   Screenshot_2.png (Size: 892.13 KB / Downloads: 244)
.png   Screenshot_3.png (Size: 700.8 KB / Downloads: 250)
.png   Screenshot_4.png (Size: 901.77 KB / Downloads: 246)
Print this item

  linux-noob member photos !
Posted by: anyweb - 2005-03-08, 10:36 PM - Forum: Hello - Replies (45)


ok then, we all talk to each other mostly live on #linux-noob (efnet server on IRC)

 

and of course here,

 

so how about showing everyone what you look like !

 

mine is easy, thats me <----- in the pic (avatar)

 

cheers

 

anyweb

Print this item

  My Windows version of my MAC
Posted by: lerum - 2005-03-08, 08:42 PM - Forum: Windows - Replies (6)


It is finally finished! :)

 

[Image: screenshot2.JPG]

Print this item

  how should i make my new partition table
Posted by: quannum - 2005-03-07, 10:20 PM - Forum: Filesystem Management - Replies (4)


Hello people,

 

do you have any suggestion what i need to change for an optimal partition table ?

 

current partition table:

 

Disk /dev/hda: 82.3 GB, 82348277760 bytes

255 heads, 63 sectors/track, 10011 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

Device Boot Start End Blocks Id System

/dev/hda1 * 1 793 6369741 83 Linux

/dev/hda2 794 859 530145 82 Linux swap

/dev/hda3 860 10011 73513440 83 Linux

 

hda1 i use for the fedora core 3 system.

hda3 is my swap partition.

hda3 i use for mp3,movie etc.

 

do you have any suggestion what i need to change for an optimal partition table ?

 

thank you for reading and replays if..

Print this item

  new wallpaper for ya
Posted by: anyweb - 2005-03-07, 09:48 PM - Forum: General - Replies (3)


heh

<a class="ipsAttachLink ipsAttachLink_image" href="<fileStore.core_Attachment>/post-1-1110232106.jpg" data-fileid="284">[img]<fileStore.core_Attachment>/post-1-1110232106.jpg[/img]</a>



Attached Files
.jpg   KillBill.jpg (Size: 210.51 KB / Downloads: 0)
Print this item

  Setup an OpenLDAP network
Posted by: xDamox - 2005-03-07, 12:59 PM - Forum: Polls - Replies (3)


In the summer would anyone be interested in setting up a LDAP server over the

internet and link all the machine togther to create a LDAP network which could have.

 

We could mess with authentacation, setting up emails etc all that :)

 

We could document each stage and post it here on the message board for

people to learn form. It would be a cool little project.

 

Would anyone be interested??

Print this item

  Unix Scripts ?
Posted by: sniffy - 2005-03-07, 10:59 AM - Forum: How Do I? - Replies (3)


Hi @ll,

 

need help in scripting.

 

I want to start every our a ipcs -a command and the output shall be stored in a sema.txt file. After every hourly command a new txt file should be created.

 

Where can i learn this ???

 

Cu,

 

Sniffy

Print this item

  Setting up a Wireless card
Posted by: xDamox - 2005-03-05, 05:37 PM - Forum: Tips and Tricks - No Replies


This little guide will help you install the following Wireless network card into Fedora Core 3 :)

 



Code:
card "ATMEL 11 Mbps Wireless RFMD PCMCIA Card"
card "ATMEL 11 Mbps Wireless 504 PCMCIA Card"
card "ATMEL 11 Mbps Wireless 504A PCMCIA Card"
card "ATMEL 11 Mbps Wireless 504+2958 PCMCIA Card"
card "ATMEL 11 Mbps Wireless RFMD Revision D PCMCIA Card"
card "ATMEL 11 Mbps Wireless RFMD Revision E PCMCIA Card"
card "Sitecom WLAN-011"
card "Belkin F5D6020"
card "3Com 3CRWE62092B 11Mbps WLAN PC Card"
card "3Com 3CRSHPW_96 Wireless LAN PC Card"
card "SMC 2632W V2 11Mbps 802.11b WLAN Card"
card "SMC 2632W V3 11Mbps 802.11b WLAN Card"
card "Actiontec 802CAT1"
card "BT Voyager 1020"
card "Siemens Gigaset PC Card II"
card "CNet CNWLC-811ARL"
card "Planet WL-3552"
card "OEM 11Mbps WLAN PCMCIA Card"
card "11WAVE WaveBuddy RFMD Revision E PC Card"
card "LG LW2100N 11Mbps WLAN PCMCIA Card"




 

The first set to installing your card is to check that it can be picked up the hardware. issue

the following command

 



Code:
cardctl ident




 

You should get a response back similar to the following

 



Code:
Socket 0:
 product info: " ", "WCard"
 manfid: 0xd601, 0x0007
 function: 6 (network)




 

Once that is done you can download the atmel drivers from [/url][url=http://thekelleys.org.uk/atmel/]http://thekelleys.org.uk/atmel/

download the Fedora core 3 version and do rpm -i <package.rpm>

 

once that is done restart the pcmcia by issueing the following

 



Code:
/etc/init.d/pcmcia restart




 

once that is done do tail /var/log/messages you shoul see your wireless card as shown below:

 



Code:
Mar  5 16:45:25 localhost kernel: eth1: Atmel at76c50x wireless. Version 0.96 simon@thekelleys.org.uk
Mar  5 16:45:25 localhost kernel: eth1: Sitecom WLAN-011 index 0x01: Vcc 3.3, irq 3, io 0x0100-0x011f




 

Well thats it hope this helps you :)

Print this item