mysql

A good approach to db planing for reporting service

The scenario: Big system (~200 tables). 60,000 users. Complex reports that will require me to do multiple queries for each report and even those will be complex queries with inner queries all over the place + some processing in PHP. The approach: I have seen an approach, which I am not sure about: Having one centralized, de-normali...

Which is best and easy way to program and show many-to-many relationship in database

I have two quantities Cat A , CatB Now the items in Cat A can belong to many items in CatB. and CatB will also have many Items from Cat A. I thinking of having Table1 for Cat A , Table2 for CatB and Table C for relation ship. with PK-A , PK-B Is that correct. How should i make my form in html so that user can select multiple val...

Start for mysql Query PHP

Hi, I'm currently looking to have a mysql query retrieve data and have and a start and limit. So like, select * from table where x = x START AT ID X LIMIT X thanks :) ...

MySql "comments" parameter as descriptor?

So, I'm trying to learn a lot at once, and this place is really helpful! I'm making a little running log website for myself and maybe a few other people, and I have it so that the user can add workouts for each day. With each workout, I have a variety of information the user can fill out for the workout, such as running distance, time,...

how does one _model_ data from relational databases in clojure ?

I have asked this question on twitter as well the #clojure IRC channel, yet got no responses. There have been several articles about Clojure-for-Ruby-programmers, Clojure-for-lisp-programmers.. but what is the missing part is Clojure for ActiveRecord programmers . There have been articles about interacting with MongoDB, Redis, etc. - ...

mysql order by on varchar

Hi in my table , there is columns called time , Field type varchar , value like HH:MM , 02-25 ,21-42,07-15 Can u tell me , how to do the order by desc , Regards Bharanikumar ...

mysql: reversed content col for LIKE '%foo' - good practise?

I was recently watching a google lecture on mysql and learnt that MySQL wont use indexes for LIKE '%foo' searches. My site's 'live search' (ajax search) searches the column full_details(TEXT), should i create a reversed version like full_details_rev(TEXT) and index that? Or should i not index large text fields at all? ...

Getting highest results in a JOIN

I've got three tables; Auctions, Auction Bids and Users. The table structure looks something like this: Auctions: id title -- ----- 1 Auction 1 2 Auction 2 Auction Bids: id user_id auction_id bid_amt -- ------- ---------- ------- 1 1 1 200.00 2 2 1...

Wordpress Database SQL query help needed

Hi, I've written a PHP script to access the latest item from the wordpress database, which it does. But I need to use it twice, once for the latest item from a specific category, and another from a differerent category... But right now I cannot figure out how to put the query together. The post has a post_parent, which in another tabl...

Optimize MYSQL Query with Order by

Hello, I have seen mysql queries with order by runs slow. Is there any specific way to optimize queries which use order by ? Queries without order by run very fast but with order by its always runs slow. if any one suggest any thing on this as general solutions. Thank You ...

What's TableName.MYD.filepart file in MySQL table (myisam engine)

I got a TableName.MYD.filepart in MySQL Database ( myisam engine) Anyone can figure out what's that file for? Appreciate! ...

mysql and php ... i want to know about optimization

in optimization in mysql wat are the topics i have to cover? there are so many things in that ....... ...

Will changing collation effect my database?

I'm trying to track down a bug with some random characters appearing when saving data to our database. So far my travels have indicated that it's a character encoding issue. I've swapped the collation on the dev to utf8_general_ci and it doesn't seem to have made a difference to the system, but I'm still unsure as to the full implicatio...

MySQL not using index on DATE when used with '<' or '>' operators?

I'm using explain to test these queries. The col type is DATE this uses index: explain SELECT events.* FROM events WHERE events.date = '2010-06-11' this doesnt explain SELECT events.* FROM events WHERE events.date >= '2010-06-11' index as follows (phpmyadmin) Action Keyname Type Unique Packed Field Cardinality Collation...

Easy comparing MySQL plans in Django

Hi, is there a way to print out MySQL query for example from this line of code Model.objects.all().order_by(sort_headers.get_order_by()) I want to plan best way of using Django but with > 1 million of objects in my model this is getting too slow. Thanks ...

MySql too many connections

I hate to bring up a question which is widely asked on the web, but I cant seem to solve it. I started a project a while back and after a month of testing, I hit a "Too many connections" error. I looked into it, and "Solved" it by increasing the max_connections. This then worked. Since then more and more people started to use it, and i...

mysql Dump does not write complete data into files

I have a program in which I use mysqldump on selected tables, the utility runs fine but at times the dump is not complete, i.e there are thousands of rows that exist in the original db and not in the dump file, can anyone help ? ...

SQL - Link to more table information

I have a datagrid with 3 of 5 fields from a SQL table. The first databound was changed to an asp:hyperlink so the field can be clicked. What I want to do is, when the user clicks an object in the field, it sends the ID to another page. From there, it uses the request in order to display the required information which is found in the same...

How to detect if a marker is inside a polygon in google maps

I've got loads of coordinates for a polygon in a database. I also have coordinates for an marker in my database. How do i detect if the marker is inside this polyon. Note: I use a cronjob to move the marker, and in this cronjob it needs to detect this. So javascript isn't involved! Shape of polygon is not just a circle or square. It c...

PHP, MySQL: Receive email, auto search in DB & send email based on the results

Hi all, Visitors can contact staff by means of contact form (visitor needs to submit email as well). This will be stored in DB. Now considering that staff responds to this message, the reply from the staff would be sent to the visitors email directly. Say if the user wants to follow up on the message sent by the staff, I would like the ...