I have a table of about 100M rows that I am going to copy to alter, adding an index. I'm not so concerned with the time it takes to create the new table, but will the created index be more efficient if I alter the table before inserting any data or insert the data first and then add the index?
...
user_table
user_id | username
1 | solomon
2 | muna
message table
id user_id| message
1 1 | this is my first message
2 1 | this is my seocnd message
3 2 | this is muna messgae
relationship table
leader | follower
1 | 2
|
what i want to do is a three table join...
Hi, I'd like to make a query where I can retrieve an interval of 10 rows with 5 tags per each one.
I have houses and tags table, I know how to do it only for simple queries with a SELECT using LIMIT but how can I do it in this case?
table houses
id house country
1 Grunt Mansion us
2 Hororo Suneku jp
3 Ca...
Let's say I have players table. It consists with 3 rows(it has much more, but let's suppose it has only 3). member_id, name, exp. I use member_id row in every page so that's why I added index only to member_id. But I want to make a top players' list in one page with the highest exp. So I do something like that:
$query = mysql_query("SEL...
I have moved my web application to a new server (nginx, mysql, php) with everything the latest version.
After that, I notice the application doesn't run very stable. Sometimes it is quick in response, sometimes very slow.
Then I look at the 'top', 'mysql-slow-log', and error log, here what I found out:
periodically, mysql-slow-log wi...
How can I match a word in a sentence from a column using regex? I tried:
"select * from table where column regex '/\b".$text."\b/i'"
but that didn't work. Thanks in advance.
...
Using Zend_Db_Profiler_Firebug and FirePHP to profile our code, all other queries after the connect is fast, but it seems to take forever for Zend Framework to establish a connection to mysql, I've googled the problem and others suggest using table metadata cache which I did, but the problem still persists.
ZendDbTableAbstract::setDefau...
I am using MySQL 5.1.47 on a Mac.
I have created a table named Stay in a database named LEAD.
When I do a show tables command, Stay appears in the list.
When I try to insert something into that table, MySQL tells me that it cannot find the 'stay' file, and gives me an errno of 2.
MySQL documentation indicates that if you get an errno...
Hi:
I have multiple processes inserting data to the same table in my database. I am using one database connection for all the processes. When I was trying to run one of the sqlcommand, I got the above exception. I did some researching online and it seems that Mysql server only support one datareader per connection. And since each proces...
I've got 2 Ubuntu 10.04 Server virtual machines running on VirtualBox with host-only network static IP address configuration.
Machine A: ubuntu-a 192.168.56.101
Machine B: ubuntu-b 192.168.56.102
Machines can ping each other via either hostnames or IP address.
MySQL 5.1 installed on both systems. I want to achieve replication with ub...
I have 1 Mysql database with 2 tables:
DOCUMENTS
...
- staffID
.....
STAFF
- ID
- Name
The DOCUMENTS table assigns each document to a single or multiple users from the STAFF table therefore the staffID in the DOCUMENTS table consists of a comma separated array of staff ID's for example (2, 14).
I managed to split the array into ...
I am trying to create a bunch of static HTML pages from a single PHP template. I want to pass an array (a row in a MySql DB) to the .php template file, so that I can use the contents as variables and get the HTML page back. What's the best way to do this? A POST request? A function? I loop through the MySQL query results in the following...
We are doing small database maintenance work to earn some money. A new client asked if we can develop a shopping website to list items to sell and buy. This is to cater 300K users,(around 20K users online at same time ). Each user has custom home page, saved setting for shopping carts, items to sell, basic reports (earning etc).
we...
First question!
I have a MySQL table which stores all content on the various pages of a site. Let's say there's three fields, id(int), permalink(varchar) and parent(int)(. parent is the id of it's parent page.
I need a query that will build a full URL of a page, I'm guessing using CONCAT. I have it working fine for two levels, but can'...
I'm trying to make an MySQL query that will display mini-blogs from Me and My friends. Just like Twitter.
Here are my tables;
--members
m_id INT
m_user VARCHAR
(rest are other member info)
--shouts
s_id INT
s_userid INT
s_content TEXT
s_posted DATETIME
--friends
f_userid INT
f_friendid INT
f_status INT // 0=pending, 1=approved
f_crea...
Is it possible to get mysql to insert a value in a column based on whats being inserted into another column in the same table. eg: if i were to insert New York in one column, the other column could automatically be NY. Yes i'll have to store this info somewhere. But is it possible to do this?
...
Hello,
I've designed mysql tables for bookings. One of them has hotels_id, rt_id, -> (room_type_id), date .....
Every rt_id has 365 rows (date). And every hotels_id has some rt_id (room types)
for example 500 hotels and 8 room types per hotel -> 500 x 8 x 365 = 1.460.000 rows.
I've used column index option for " hotels_id, rt_id, da...
I was just wondering if there was a super quick way to automatically add a filtering system into Drupal views.
I.e. I just need to add in the top of my view search by name (text box) and search by category (drop down box)
Or do I just manually create this form then use the filter agruments within the edit view screen?
...
I am creating a large web application with Zend Framework 1.10. A am new in Zend Framework(1 month experiance). Can you explain me how to create a admin module in the best way?(with own authentication). How to make this with good security?
Thanks a lot.
...
echo strtotime('2010-09-11 12:15:01');
Returns: 1284207301
SELECT UNIX_TIMESTAMP('2010-09-11 12:15:01')
Returns: 1284200101
Why the difference?
...