Note that there are some explanatory texts on larger screens.

plurals
  1. POBest practices(or best engine) for search performance AND data integrity
    primarykey
    data
    text
    <p>This might be too general or subjective of a question but I need help and I'm not even sure what the correct and concise questions are. I've done a lot of google searches in the past few days trying to make sense of this and I'm more confused than ever about what approach to take.</p> <p>In MySQL I've built a database for a product catalog. I have to keep track of a few many-to-many relationships such as products-tags, products-categories, so I decided I would need to use <code>INNODB</code> in those tables, so that I could make use of <code>FOREIGN KEY</code> constraints. That's all fine, BUT. <code>INNODB</code> does not support <code>FULLTEXT</code>. I've read that it is bad performance to use <code>LIKE '%WORD%'</code> in <code>WHERE</code> clause because no index can be used when wildcard prepends a search word. The database will likely have a lot of entries at some point and I don't want searches to take forever.</p> <p>So how does one have their cake and eat it too? Do I need to choose one or the other: <code>FULLTEXT</code> or <code>FOREIGN KEY</code>? Should I make a sort of summary <code>MYISAM</code> table consisting of only the most search relevant columns, and use triggers on the INNODB tables to keep it updated? Wouldn't that -at least partially- defeat the bonus of using <code>FOREIGN KEY</code> constraints in the first place: eliminating duplicate and superfluous data? What is the best pattern to make searching a large database work with the best possible performance - at least in respect to using <code>INNODB</code> vs. <code>MYISAM</code>?</p> <p>I would greatly appreciate it if someone bright and experienced could at least point me in the right direction. Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload