Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Without the use of an index, a database has to perform a "full table scan". This is rather like you looking through a book one page at a time to find what you need. </p> <p>That being said, computers are a lot faster than humans. It really depends on how much load your system has. Using MySQL we successfully implemented a search system on a table of lead information. The nature of the problem was one that could not be solved by normal indexes (including full text). So we <strong>designed it</strong> to be powered using a full table scan.</p> <p>That involved creating tables as narrow as possible with the search data, and joining them to a larger table with related, but non-search data.</p> <p>At the time (4 years ago), 100,000 records could be scanned in .06 seconds. 1,000,000 records took about .6 seconds. The system is still in heavy production use with millions of records.</p> <p>If your data needs exceed 6 digits of records, you may want to re-evaluate using a full text index, or do some research on inverted indexes.</p> <p>Please comment if you would like any more info.</p> <hr> <p><strong>Edit:</strong> The search tables were kept as narrow as possible. Ideally 50-100 bytes per record. ENUMS and TINYINT are great space savers if you can use them to "map" to string values another way.</p> <p>The search queries were generated using a PHP class. They were simply:</p> <pre><code>-- DataTable is the big table that holds all of the data -- SearchTable is the narrow table that holds the bits of searchable data SELECT MainTable.ID, MainTable.Name, MainTable.Whatever FROM MainTable, SearchTable WHERE MainTable.ID = SearchTable.ID AND SearchTable.State IN ('PA', 'DE') AND SearchTable.Age &lt; 40 AND SearchTable.Status = 3 </code></pre> <p>Essentially, the two tables were joined on a primary key (fast), and the filtering was done by full table scan on the SearchTable (pretty fast). We were using MySQL.</p> <p>We found that by having the record format == "FIXED" in the MyISAM tables, we could increase performace by 3x. This meant no blobs, no varchars, etc...</p> <p>Let me know if this helps.</p>
    singulars
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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