On Wed, 2001-12-05 at 16:33, Arjen G. Lentz wrote:
> 
> ----- Original Message -----
> From: "Florin Andrei" <[EMAIL PROTECTED]>
> 
> > SELECT event.cid, iphdr.ip_src, iphdr.ip_dst, tcphdr.tcp_dport FROM
> > event, iphdr, tcphdr WHERE event.cid = iphdr.cid AND event.cid =
> > tcphdr.cid AND tcphdr.tcp_flags = '2';
> 
> So, MySQL actually has no index to work with.
> So, you will want to add an index on cid alone, for the event and iphdr tables
> (tcphdr table doesn't matter since your select will use the tcp_flags index to
> limit down the first part of the join, as described above).
> Making sense?

Yes. Thank you.

Now, suppose i don't know how my SELECTs will look like. Suppose i
collect "general purpose" data, and i will devise my data mining schemes
later. Therefore, i guess it may make sense to add indexes for almost
all columns that might be used to search for data.

But then, an index will slow down the INSERT speed, right?

What's the performance penalty for INSERTs when i have indexes for
almost all columns? (the tables have 5...10 columns, all of them
integers of one sort or the other) It will slow down INSERTs 2 times? 10
times? More?

-- 
Florin Andrei

"The security of any corporate network is inversely proportional
to the number of systems administrators on the network." -
- Petreley's law of sysadmins


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to