May 26, 2012

Comment: Database problems in MySQL/PHP Applications

… (if used properly) help increase security against sql injection. > For example I have little …the database to do row lookups by multiple columns of varchars is likely. Don’t do …re here to help. Partial agreement: “Use Indexes smartly.” Indexing columns that have very low cardinality will often…

Post: Using UNION to implement loose index scan in MySQL

indexes in all cases when it is technically possible. For multiple key part indexes MySQL will only be able to use multiple…| +———————————-+ 1 row in set (0.06 sec) mysql> SELECT SQL_NO_CACHE name FROM people WHERE… and put zip as first column in the index as it is more selective…

Post: Using Flexviews - part one, introduction to materialized views

SQL query, and what we normally think of as a result set is really a virtual table. It has columns…, not each time the view is accessed. If multiple statements access the same view repeatedly or concurrently… table will be considerably cheaper You can add indexes to the MV. Since the data is already…

Post: Shard-Query EC2 images available

… splitting and/or loading among multiple nodes as well. Note that…: 1616904192 Max_data_length: 0 Index_length: 539279360 Data_free: 4194304 …of columns to show (click show/hide to change the columns) That the… shard-query/ $ ./run_query < queries.sql | tee raw |./pivot_results & [1] 12359 $ tail…

Post: Talking MySQL to Sphinx

… MySQL wire protocol and SphinxQL – SQL-like language to query Sphinx indexes. This support is currently in its…As you can see Sphinx adds couple of extra columns to result set even if you have not… its ability to scale almost linearly using multiple CPU cores and multiple nodes in the system. The raw…

Post: Why MySQL could be slow with large tables ?

…some respect and what works well for Oracle,MS SQL, PostgreSQL may not work well for MySQL and …index) you would need 2+ IOs to retrieve the row which means you get about 100 rows/sec. Note multiple…the table with over 30 millions of rows. “val” column in this table has 10000 distinct value, so range…

Post: Using MMM to ALTER huge tables

… require table to be rebuilt – adding/dropping columns or indexes, changing data type, converting data to …the sql scripts $ mysql -u root db < changes.sql At this step we load sql commands from changes.sql … replication has caught up. If you have multiple pairs doing some changes in parallel and …

Comment: MySQL VIEW as performance troublemaker

… want to create views, should have proper primary key and indexes (make sure you do it before dumping data in the… 3. drop off any columns which you dont require, or create multiple views, based on the column required 4. increase sql cache / memory (hosting…