designing for speedy access question

"Bill Angus" <[email protected]>
Newsgroups gmane.comp.db.mysql.windows
Message-ID <001001c628f7$c392aa80$0201a8c0@billhome>
I am trying to design an app that will store quotes, customer orders and invoices (where invoices are completed customer orders and have the same format, and quotes are optional, but similar to orders -- so that a quote can simply become an order when the customer accepts it).

Is it reasonable to store invoices quotes and orders in the same table, only classifying which type a record is by using an integer RecordType field?

If so, how is the best way to set up the index files so that for example, speedy access of invoices by customer takes place and mySql server doesn't work hard to filter quotes and customer_orders in order to locate invoices?

Is it sufficient to index the file on RecordType? Will MySql automatically use such an index to speed up queries which might select invoices by customer (or by some other field) but not unfilled orders or quotes? Or do I have to specifically need to set up and index on both RecordType and CustomerNumber to design for speediest possible access?

Finally, is my general design idea flawed?... i.e. is it actually better to make 3 separate files having more or less the same schema, and not to store the data in a single file?

Thanks and have a great day!

Bill Angus, MA
http://www.psychtest.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.