mysql

What are some optimization techniques for MySQL table with 300+ million records?

I am looking at storing some JMX data from JVMs on many servers for about 90 days. This data would be statistics like heap size and thread count. This will mean that one of the tables will have around 388 million records. From this data I am building some graphs so you can compare the stats retrieved from the Mbeans. This means I w...

MySQL date/time calculation

I have a date and time column in my mysql table called start_date and start_time respectively. I want my users the ability to set reminders for themselves to be sent X hours before start_time, min. 1 hour and max 24 hours. I'll be running a CRON script to send these reminders. Right now I do: SELECT * FROM auctions WHERE start_date=CUR...

Zend Framework: Proper way to interact with database?

I'm fairly new to the Zend Framework and MVC and I'm a bit confused by Zend_DB and the proper way to interact with the database. I'm using the PDO MySQL adapter and have created some classes to extend the abstract classes: class Users extends Zend_Db_Table_Abstract { protected $_name = 'users'; protected $_primary = 'user_id'; ...

Grouping SQL data in mysql side, or PHP?

I have the following tables in mysql: team: id, name, [more stuff] person: id, name, team, [more stuff] entry: id, name, team, [more stuff] registrations: id, event_id, team, status registration_people: registration_id, person_id registration_entries: registration_id, entry_id I would like to query the database and return details abou...

PHP / MySql Verbosity VS over the wire

I have been starting to write some reasonably large and or confusing MySQL queries in PHP. I am trying to find a balance between verbosity and performance... If performance has anything to do with it or not is my question. It being white space and MySQL comments inside of my queries. It would make sense to me that PHP would filter the q...

Ecommerce tool for selling services

I am looking for a good ecommerce CMS. I need to be able to sell services and products, it must be open source that it can be customized wherever needed. I am very familiar with PHP and Mysql, and somewhat familiar with python and ruby, so a PHP solution would be preffered. ...

Can MySQL 5.0 Community Edition scale up to meet a large user base?

I need to create a social-networking application that is going to attract quite a significant number of users for its use and is going to require high scalability capabilities. I would prefer an open source solution and had MySQL in mind. But I need to know if MySQL will give me what I am looking for. ...

Repository Pattern without LINQ or other ORM?

Does it makes sense to use the Repository pattern without the use of LINQ or some other ORM? I am writing an application in MONO and using MySQL, was thinking of using the repositoy pattern but not going to be able to deal with IQueryable. I was thinking of just exposing more methods on the repository to make it obvious that filtering ...

Character set woes

I have a small ajax application built with php. Using phpMyAdmin I have set a mysql database to utf-8, and have imported a textfile containing utf-8 data into it. This worked fine on a windows machine with easyphp, after adding character-set-server=utf8 and default-character-set=utf8 to the my.cnf file. I have now tried to move this t...

Adding ORDER BY clause to MySQL query makes it return in ~30 seconds, up from ~0.5

So I have this query that is relatively fast at ~0.5 seconds but when I add an ORDER BY clause it jumps up to nearly 30 seconds. Original query: (returns in ~0.5 seconds) SELECT table1.*,table2.* FROM table1 LEFT OUTER JOIN table2 ON table1.column2=table2.column3 WHERE table1.column1='value' LIMIT 4 Query with ORDER BY: (returns in ~...

Multiple MySQL instances on a single machine

How to configure multiple MySQL instances on a single machine? There are a lot of information on the web, but they are not very useful. Instead of generic information that can only be understood by a mind with years of MySQL administrative experience, I am looking for a tutorial that guides me from begin to end. I would appreciate answe...

Rather difficult mySQL problem ...

Hello there, A friend of mine is having an problem with an big mySQL database and quite a big number of repeating columns over multiple tables. To describe the problem better, the database serves multiple services like FTP, Postfix, webmail, pretty much all the common services you would be running on a general use Linux server and all ...

Where does Leopard Server's MySQL store its data?

I'm trying to recover a table in a MySQL database from Time Machine, however I don't know and can't find where Leopard Server's MySQL stores its data files. Does anyone know where they are stored? Is there an easy way to run mysqldump on them without restoring them? Is there anything else I should know about Time Machine and MySQL data...

Wordpress Category ID vs Eval Issue

Hi Ok this is a little complex. I am creating a plugin, and want to find the category ID from the Post page. That's the easy part. What makes it complex is I am doing it within an ob_start (started in a 'template_redirect' action) as I want to edit the full page before it is returned to the browser. Again that is easy enough from the ...

How to export MYSQL Database tables from one server to another

Hi , How do I export and import MYSQL database selected tables(not all) from one machine to another machine ? cheers ...

Sql Ansi to manage DateTime values

I'm developing a multi-database system. I want the difference between two dates in seconds. In SQL Server I got: DATEDIFF(second,stardate,enddate) In MySql: TIME_TO_SEC(TIMEDIFF(stardate,enddate)) My question: Does Sql Ansi have functions to manage DateTime values? i.e.: There are datetime functions generic for all databases? ...

MySQL AUTO_INCREMENT does not ROLLBACK

I'm using MySQL's AUTO_INCREMENT field and InnoDB to support transactions. I noticed when I rollback the transaction, the AUTO_INCREMENT field is not rollbacked? I found out that it was designed this way but are there any workarounds to this? ...

Webbased MySQL interface better that phpMyAdmin

Is there any webbased interface for MySQL better than phpMyAdmin? I use phpMyAdmin a lot but it is becoming a pain, especially it is slow sometimes. I'd like to have deep export functionality like phpMyAdmin but more design features ...

Tracking users referral (PHP / MySQL)

Greetings, Is there any script that keep track users referral and set cookie on users referred so whenever they leave site and come back, it still will be count as referred by person.. thanks. ...

Strange Encoding Problem

I have a table of datas encoded in latin5 charset and all the columns in the table are also latin5. From mysql console when I enter "SET NAMES 'latin5'" and query the table results are ok . When I try to delete or insert/update all the new data's encodings are perfect. But when I try to insert Iso-8859 data (also verify this with mb_dete...