Slow Queries When Using Views Compare To Direct Table Queries
I’ve having problems with my server load for a while now. I have two tables with different content, but I need to display them in the same results, so I created a view with a union all (named: top_news_videos). The problem that I’m seeing is that when running a select to the view it takes a lot longer (and in that way, more server intensive) than running the query directly to one of the tables. For example, I created a page where I run 7 queries similar to this one:
MySQL Code: ...
View Complete Forum Thread with Replies
Related Forum Messages:
Too Slow Queries
I am using version 5.0.4. I noticed that suddenly my queries were becoming too slow. I have data in three tables, with 40,000 rows, 50,000 rows and 70,000 rows respectively. I was able to run queries that joined the three tables together and get the results in less than 5 seconds. I tried updating the tables through a program that used a stored procedure to delete the tables but I had some other problems. Since the I restored the data in the tables from backup databases. Now I can't run any queries that join the three tables together, it waits for a long time and then times out. The data in the tables look good. Now I can't get the results from any of the other backup databases either. It look like the entire MySQL server has slowed down greatly. I tried rebooting the server to no avail.
View Replies !
Slow Queries!
I have a website which has a users table in a mySQL database. This users table is large (It has about 25 columns - most varchar(100)) but only has about 10000 records. The records contain user information which is searched with a javascript form. My problem is that when I click to 'view all', it takes about 7 seconds to load. This seems a lot? Does 25 cloums seem sxcessive in a table? Can anyone point me to some good tutorials / docs on improving query performance? I have defined the colums as best as I can, but I am using SELECT * from table, would selecting individual columns make a big difference?
View Replies !
What Causes Slow Queries
What causes periodic slow queries? I have checked my slow query logs and for some reason everyonce in awhile, a query thats never slow might be for example, one took 3 seconds to execute and every once in awhile a chat might take 10 seconds of cpu time while rest of the time 0.09...why is it it flexuates so much?
View Replies !
How To Log-slow-queries
I'm running MySQL 5.0. Now I would like to log-slow-queries. With MySQL 4 I used mysqld --log-slow-queries --log-long-format start but now I get following note: mysqld: Too many arguments (first extra is 'start'). Use --help to get a list of available options It looks like starting and stopping now only works with etc/init.d/mysql start
View Replies !
Slow Queries And Optimization
I am hosting a site with an increasing number of members. Letely the site has become slower because of too many queries are being used. Is there a way of asking the server which queries are used most often, as well as asking which queries take a long time to process so that I would know where to start my optimization process?
View Replies !
Slow View Queries
I have a fairly complex view which, when you execute a SELECT * shows all info very quickly (0.24 seconds to return nearly 3000 rows). However, when I start throwing slightly more complex queries at it, things really slow down - an average query can take 40 seconds to execute.
View Replies !
Slow Queries With LIMIT
Working with a large table (1 Million Records). Setting up pagination using LIMIT command. Queries near the end of the table are slow when non-indexed fields are selected (but not included in the 'where' clause). For example: With indexes on id (PK), and type: SELECT id, user_id, name, type, selected, creation_date FROM titans where type = 2 LIMIT 500010,10; +---------+---------+------------+------+----------+---------------+ | id | user_id | name | type | selected | creation_date | +---------+---------+------------+------+----------+---------------+ | 1000016 | 100001 | Uni Ekko | 2 | 0 | 1228149051 | | 1000017 | 100001 | Dynaneedle | 2 | 0 | 1228149074 | +---------+---------+------------+------+----------+---------------+ 2 rows in set (4.17 sec) If I only search on the ID field, the query is much faster. mysql> SELECT id FROM titans where type = 2 LIMIT 500010,10; +---------+ | id | +---------+ | 1000016 | | 1000017 | +---------+ 2 rows in set (0.36 sec) explain SELECT id, user_id, name, type, selected, creation_date FROM titans where type = 2 LIMIT 500010,10; +----+-------------+--------+------+-------------------+---------------+---------+-------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+--------+------+-------------------+---------------+---------+-------+--------+-------------+ | 1 | SIMPLE | titans | ref | avatars_indx2,tst | avatars_indx2 | 2 | const | 381988 | Using where | +----+-------------+--------+------+-------------------+---------------+---------+-------+--------+-------------+ 1 row in set (0.01 sec)
View Replies !
Do Unnecessary Parentheses Slow Queries Down?
I know a person who seriously writes queries like this: SELECT * FROM my_table WHERE ((((my_col = 30))) AND (((other_col = 40)))) I told him all those parenthesis were unnecessary and he responded that he does it so later if he has to add more criteria the parenthesis will be there. I about fell out of my chair that sounds so ridiculous. So my question is, other than the obvious ugliness and being hard to read, is there any other reasons why NOT to do this?
View Replies !
Optimizing Slow Queries On Millions Of Records
I have a table that has millions of records in it. About 100 records are added every 5 minutes (one per OIDID) (the sample provided below has data for 2 OIDIDs (99 and 100) And I have a webpage that executes 9 queries one after the other, and then displays the results on the webpage. When the database was empty, this process was very quick. But, as the DB grew, it became slower. Now it takes about 38 seconds for all queries in the example below. MySQL 4.1 on Windows I have tried different indexes, and they do help and are used, but the queries still seem to take a long time. Code:
View Replies !
Fine Tune :: Timeout Slow Queries?
I have a very busy database with some tables having hundreds of thousands of records. I am running MySQL 5.0.16 on Windows. Some of the queries running on my database are not fined-tuned enough, and need improvement. However, the system is live in production and I am looking for a way to prevent MYSQL from committing Harakiri, i.e. from running very slow queries forever, taking the cpu to 50% and beyond for hours. My scripting language is PHP. I found that after a while the end user receives a timeout on the browser, but MySQL continues trying to run the query, sometimes for hours. My question is, is there a way to specify a timeout for MySQL so that it will abort any queries that it is running that have not returned a result by then. The end user is no longer around anyway, so I am looking for a way to protect the database resources (and in parallel I will start investigating how to optimize the slow queries)
View Replies !
MySQL Timing Out? Really Slow Queries, Already Indexed.
For whatever reason, MySQL does not seem to be executing. So, I ran a few stat functions and here is what I got: Uptime: 220372 Threads: 39 Questions: 18748899 Slow queries: 808 Opens: 28723 Flush tables: 1 Open tables: 4096 Queries per second avg: 85.078 The "open tables" worries me for a few reasons. First, because it is 4kb (exactly, since it is divisible by 1024, evenly). This makes me think that maybe I am hitting a ceiling. Second, there are a few variables in MySQL that equal this, and maybe it's a cap on something. Here are the variables that equal 4096: query_cache_min_res_unit = 4096 table_cache = 4096 transaction_prealloc_size = 4096 Do any of those have anything to do with this? Am I even close? Are any of those values from mysql_stat a big deal?
View Replies !
Slow Queries, 4 Million Records, Need Educated Advice!
I have created an app a few years back to store some records in a DB. According our calculations we were never to exceed 500,000 records in the DB. Seems we were off by a decimal point or so. I set up a FreeBSD box with MySQL three years back and it has been filling up. One table has over 4,000,000 records. Yes, four million. As a web developer and not a DBA, I have struggled to upkeep the server the best I can. As of the last one million records the server has been struggling to keep up with multiple requests and as you can imagine the user base is growing too. Hardware: Dual Xeon 3.06 Ghz 4 GB ECC RAM 800GB RAID5 SATA array Software: FreeBSD 5.3 Apache 2.0 PHP5 MySQL 5.0.2 Basically I have to perform a search on one of two columns in this huge table (10 columns, 4 million rows). The table is MyISAM with a single primary key that is used largely for updating row data. Most records are ten digit numbers for one column and a ten digit varchar for the other, but sometimes either column can be a series of characters up to 100 chars long, so each column is set for varchar(100). The action performed is SELECT count(*) FROM tableName WHERE col LIKE "%123%" then... SELECT * FROM tableName WHERE col LIKE "%123%" LIMIT 0,25 with "%123%" being any random string typed into a search window.
View Replies !
Complex Queries Versus Multiple Simple Queries
I am constructing a database to contain information about stories posted on my site. Information included will be things like title, author(s), genre(s), story codes, synopsis, etc. I worked out that storing this information properly, so that it can all be searched on, could take as many as ten tables. My question is this: Is a single complex query really better (more efficient for the server) than multiple simple queries? In other words, I may need the information for as many as 25 or even 50 stories for a single page. Is it better to get all of the information out of a single, massive, complex query, or is it acceptable to get the information essentially one story at a time, which could mean 25 or 50 simple queries...?
View Replies !
Many Smaller Queries Vs. Large Comlicated Queries
I am wondering if any one can help me. I have a page that will run around 85 smaller queries but if i combine the queries it will go down by almost half. This page is a high traffic page and I don't a complicated query taking up mysql resources while it created a temp table and such. My question is this: Is it better for mysql to run a lot of smaller queries (ex: simple selects with zero or one join, group by) or one larger complicated query with everything combined. The thing i have to keep in mind is that the mysql selects are comming off the localhost that the web server is also running on so they share the same resources.
View Replies !
Long Queries VS Multiple Short Queries
I have a php script that requests a very long query from our mysql database. It has lots of joins and accesses at least 5-6 tables. My question is should i break it up into smaller separate queries or leave it as one long one, in regards to best practices?
View Replies !
Queries Between 2 Table
I am currently designing database and facing few problem about queries. Here it goes. I have 2 table: table 1 (consists of 2 fields:Student Metric and Course Id) and table 2 (consists of 4 fields: Student Metric, Class Id, Date, Time). Now I need to list a query between the 2 tables that lists the Student metric fields which contained in table 1 but not contained in the table 2. How suppose can I do that?
View Replies !
Combining Two Queries On The Same Table
I am running mysql 5.0.51a and have a table with the following structure ID, Date, startTime, stopTime, Name I want to find the last stopTime from yesterday for each name and the first startTime from today for each name. I have tried using union but end up with a stopTmes for today and yesterday as well as the startTimes for today and yesterday for each name. I also tried using sub queries but get an error as there is more than one result for each query. How can I create a query to just get the the yesterdays stop time and todays start time only for each name.
View Replies !
Table Exists In Queries
How do I alter a MySQL insert, update or select statement to fail gracefully, without producing an error, if the table doesn't exist? I know it sounds weird, but I have a table that's used for logging certain non-critical information. I have an external process that periodically backs up this table. It backs up the table by renaming it with a number after it (for example, table "log" becomes table "log_1", "log_2", etc) and they are organized so that it only saves the last 10 and keeps the names consistant, etc. But that's beside the point.
View Replies !
Slow Join On Otherwise Fast Views?
select * from vw_fielddata takes 16ms to return just four rows, why does select * from vw_fielddata firstname join vw_fielddata secondname on secondname.AccountID = firstname.AccountID take over an hour? The views themselves contain joins on tables and further views, and although AccountID isn't a primary key from the tables it's gathered from it is a foreign key in them (I assume this makes it indexed?).
View Replies !
Combining Union'd Table Queries (or Not)
I'm working on a CMS driven by a database filled with information about the animal kingdom. At the moment, my site just includes vertebrates, but that's still well over 50,000 rows just for each taxon's name, divided between various tables (mammals, birds, etc.). My initial query selects only the field Name from my combined tables, so I can display dynamic pages named MySite/Life/Canidae, MySite/Life/Reptilia, etc.... PHP $result = mysql_result(mysql_query("SELECT COUNT(*) FROM ( SELECT GZM.Name FROM gz_mammals GZM WHERE Name = '$MyHome' UNION ALL // ($MyHome more or less equals my dynamic URL in all these examples. For example, if the URL is MySite/Life/Canidae, then $MyHome = Canidae.) My second query - another union of all my tables - is designed to fetch some very basic information about taxonomic rank (family, class, etc.) and parent-child relationships... PHP $result = mysql_fetch_assoc(mysql_query("SELECT * FROM ( SELECT GZM.Name, GZM.Parent, GZM.Rank FROM gz_mammals GZM WHERE Name = '$MyHome' UNION ALL SELECT GZB.Name, GZB.Parent, GZB.Rank FROM gz_birds GZB WHERE Name = '$MyHome' // I won't list all the tables here. ) AS Animalia")); This is followed by two other queries that fetch grandparents, great grandparents, etc. and children, grandchildren, etc. Each of these tables is also a union query, and each seems awfully redundant of my second table. So there are two ways I can simplify things: 1. Combine my second table (the one I described just above) and my Grandparents table (which I'll post shortly) - if that's possible. 2. Use the results from the table I just described to divide my subjects into mammals, birds, etc. Then I can simply query one table at a time with my third query. For example, if my URL is MySite/Life/Tiger, it would only query the table gz_mammals. This is the Grandparents table: PHP // Great Grandparent $GGP = getParent(getParent(getParent($MyHome))); // Grandparent $GP = getParent(getParent($MyHome)); function getParent($MyHome) { $query = "SELECT * FROM ( SELECT GZM.Name, GZM.Parent, GZM.Rank FROM gz_mammals GZM WHERE Name = '$MyHome' UNION ALL // Followed by more tables... ) AS Animalia"; $results = mysql_query($query) or die ("An error occurred: ".mysql_error()); $myrow = mysql_fetch_array($results); return $myrow['Parent']; Again, is it possible to combine the last two queries I described? If so, do you think it's a good idea, or would I be better off with two separate tables, with the third (Grandparents) table simply modified to query just one table (e.g. gz_mammals)? I'm going to be writing all sorts of queries to suck a wide variety of information out of my database, so I'd like to at least get my preliminary queries squared away.
View Replies !
Multi-table Queries Returning 0 Rows
I'm working on a Windows client program in C++, using Qt and OleDbPro (for database access). Everything was working great until I had to use a query for the first time in the code that pulled data from two tables. The query executes, but returns 0 rows. I verified that the query should return rows by running the query both through another client using an ODBC DSN, and using phpMyAdmin; both times, I got the result I expected. I'm using the following connection string: Driver={MySQL ODBC 3.51 Driver};server=2ksvr;database=mydb;uid=user;pwd=pa sswd;option=16386 I tried with and without using the JOIN format, someone suggested some ODBC drivers don't work well with JOINs, but didn't make any difference So, the question I have is, is there something special I have to do for a DSN-less connection using an ODBC provider?
View Replies !
Referencing Safe Field And Table Names In Queries
I've looked through the documentation and searched online (and maybe I'm just slow today) but I can't find the answer to what I thought would be an easy question. If I have a field or table that's named with a reserved word or contains a special character, how do I safely reference it from a SQL query? For example: Field name: "Mike's" Table name: "Into" "Select Mike's From Into" will result in an error because I haven't escaped these special words/characters.
View Replies !
Analyze Table - Optimizing Time-consuming Queries
I'm starting a website-counter service, so basically my site requires a lot of mysql activity. Here are the two tables I use: CREATE TABLE `traffictrack` ( `id` int(11) NOT NULL auto_increment, `nr` int(11) NOT NULL default Ɔ', `ip` int(10) unsigned NOT NULL default Ɔ', `ndate` datetime NOT NULL default ��-00-00 00:00:00', PRIMARY KEY (`id`), KEY `ndate` (`ndate`) ) CREATE TABLE `tracker` ( `nr` int(11) NOT NULL auto_increment, `email` varchar(70) NOT NULL default '', `password` varchar(220) NOT NULL default '', `mdate` datetime NOT NULL default ��-00-00 00:00:00', `ip` int(10) unsigned NOT NULL default Ɔ', `image` varchar(200) NOT NULL default '', `friendid` int(11) NOT NULL default Ɔ', KEY `mdate` (`mdate`), KEY `nr` (`nr`) ) I have some queries that take up more than 1 second: PHP SELECT INET_NTOA(traffictrack.ip) as ip, tracker.image, UNIX_TIMESTAMP(traffictrack.ndate) as ndate, tracker.friendid, ( UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(traffictrack.ndate) ) as dif FROM traffictrack LEFT JOIN tracker USING(ip) WHERE traffictrack.nr = ?' AND DATE_FORMAT(traffictrack.ndate, '%Y-%m-%d')=��-07-23' ORDER BY traffictrack.ndate DESC LIMIT 20 also: PHP SELECT COUNT( traffictrack.ndate ) AS total, tracker.image, tracker.friendid, UNIX_TIMESTAMP(traffictrack.ndate) as timest FROM traffictrack LEFT JOIN tracker USING ( ip ) WHERE traffictrack.nr = ?' AND ( UNIX_TIMESTAMP( ) - UNIX_TIMESTAMP( traffictrack.ndate ) ) < 600 GROUP BY tracker.nr LIMIT 0 , 30 I believe it's because my tables are badly indexed, I added an EXPLAIN before these two queries, they both ended up with: id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE traffictrack ALL NULL NULL NULL NULL 34246 Using where; Using temporary; Using filesort 1 SIMPLE tracker ALL NULL NULL NULL NULL 20972 If someone knows how to speed up my queries, please help.
View Replies !
Multi Table Queries Returning 0 Rows With DSN-less Connection ViaOLEDB
I'm working on a Windows client program in C++, using Qt and OleDbPro (for database access). Everything was working great until I had to use a query for the first time in the code that pulled data from two tables. The query executes, but returns 0 rows. I verified that the query should return rows by running the query both through another client using an ODBC DSN, and using phpMyAdmin; both times, I got the result I expected. I'm using the following connection string: Driver={MySQL ODBC 3.51 Driver};server=2ksvr;database=mydb;uid=user;pwd=pa sswd;option=16386 I tried with and without using the JOIN format, someone suggested some ODBC drivers don't work well with JOINs, but didn't make any difference So, the question I have is, is there something special I have to do for a DSN-less connection using an ODBC provider?
View Replies !
Guidance Needed For Making Random Queries In A Huge Table
Bigint id Varchar name Enum gender Tinyint age Varchar city Smallint countryAndstate (All country+state combinations have a unique id number stored here) id is some unique random number generated per user and is the primary key, and gender, age, city and countryAndstate are indexed individually. Now, 70% of our queries are like: "where id=1234" or "where id in(1234,5678)", which work fine. However, the other 30% queries can be: 1. Give me 100 rows randomly 2. Give me 100 rows randomly that satisfy certain conditions (like age=33 or city='Boston' or a combination, like gender='Male' and city='San Francisco' and countryAndState=101)
View Replies !
How To Put These Two Queries Together?
Howto put these two queries together? sql = "SELECT DISTINCT medium_id, COUNT(tag) AS count FROM tags WHERE tag = 'test' GROUP BY medium_id ORDER BY count DESC" This query is working. Id like to try something like: sql = "SELECT * FROM media WHERE id IN (SELECT DISTINCT medium_id FROM tags WHERE tag = 'test')" But how can I order the resut by quantity (counts of tag)?
View Replies !
1 Or 2 Queries
I have an established schema of databases and tables. A requested feature came up, that would allow for a user to add an item to the database, and not have it display on the website. Would it be better for the site to run a query along the line of SELECT * FROM db.table WHERE item=item AND view='yes' or Get the data then run a query against a separate table to see if the part is in the not viewable database
View Replies !
2 Queries
it won't run both queries and unite them - it's ignoring 'where approved='yes')? : Code: $sql = "SELECT CONCAT(firstname , ' ' ,lastname) AS FullName, username, homepage FROM customer WHERE approved='yes' AND lastname LIKE 't%' OR username LIKE 't%' ORDER BY lastname ASC";
View Replies !
WHERE (xyz OR Abc) Queries?
I'm just wondering if it's possible to include some sort of "OR" type condition in MySQL queries? I'm assuming it can be done, but I can't seem to find anything, and of course typing MYSQL +"OR" into a search engine doesn't bring the most specific of answers.
View Replies !
2 SQL Queries
2 questions I'm hoping someone will be kind enough to help me with: Firstly, is it possible to do something like: SELECT * FROM (SELECT `table_name` FROM `table_list` WHERE `type` = 4 LIMIT 1); I'm trying to select the table name to use by querying another table. Secondly, I'm trying to use variables to tidy up another query: SELECT @r := TRIM(TRAILING '_' FROM `long_room`) AS 'Room' ... WHERE @r LIKE 'WL214'; Am I using variables in the right way? This doesn't return anything and using "'Room' LIKE 'WL214'" doesn't work. I know I can use the whole Trim statement in the Where clause, but I want a tidier way of doing it.
View Replies !
Max Queries
Using JDBC and a connection pool, MySQL 5.0 on Debian Sarge, does anyone have any prior knowledge or a suggestion - should I limit the number of queries per connection? If so - to what number? (I've already got a maximum time to live for a connection, so at any case I'm not going to reuse a connection forever). Is using and reusing a connection memory-consuming, tending to grow over time?
View Replies !
Best GUI For Queries
I currently use myqlcc instead of query browser, but have been looking for a replacement that might combine some of the best features of both (plus one still being updated). I use the prog for writing and running queries, not so much for administering the db. I don't hear a lot written about them, but these are what I consider to be the best features of mysqlcc, which I can't find replicated in other progs. Can anyone recommend a GUI that has at least some of them? --Table/field highlighting (recognizes real db data and highlights it when entered) --Autocomplete (shows me possible matches from partial entries with a keystroke) --Parentheses highlighting (lets me see what is in a given start/end parenthesis) --update/delete results messages (shows xx rows matched, yy rows affected) --Tabbed multi-threading (of course) --Ability to grab all/some results and copy to the clipboard for export to Excel (not all have this) Anytime I try to google favored applications, I come up with Navicat, which seems to have the budget to buy search results; doesn't make it a good program (does anyone like it?).
View Replies !
Queries Per Second: 135.73
According to Runtime Information: Queries per second: 135.73 Is this an acceptable value, or is this a sign that something is probably wrong? The site gets about 300k page views per day.
View Replies !
Two Queries At The Same Time?
I have 2 queries: The {..} are precalculated values. At the beginning no item can be matched by both where clauses. 1) update tabelle set L = L + {MOVE} set R = R + {MOVE} where L >= {LEFT} and R <= {RIGHT} 2) update tabelle set L = L - {DIFF} set R = R - {DIFF} where L >= {OTHERLEFT} and R <= {OTHERRIGHT} My problem: If I run update 1 first, the update 2 can match items from where clause 1 because the update changed the values from L and R so that they can be found at where clause 2. And if I run 2 first its the same in the other direction. So how can I do the 2 where clauses first, and when mysql knows my items I would like to update so no item gets updatet twice.
View Replies !
How To Log Specific Queries
I've got this DB. Every few minutes new data comes in and is inserted. Now and then for some reason duplicate data comes through - not a big problem - unique key. However I'd like to log the insert failures, due to dupes, but I don't want to log all of the good inserts also.
View Replies !
Join 2 Queries Into 1
I would like to know how to join 2 queries so that the results of these 2 queries show up in the same query: SELECT b.bios_serial_number FROM bios b: SELECT s.system_name FROM system s; Basically I want to create a report that includes both system name and serial number. I'm new to this and none of the JOIn documentation was clear to me.
View Replies !
IN Vs Individual Queries
If I needed to fetch 3 entries from a database, is there a significant performance difference between the following? SELECT * FROM JOBS WHERE myCol IN ('val1','val2',val3'); Versus SELECT * FROM JOBS WHERE myCol ='val1'; SELECT * FROM JOBS WHERE myCol ='val2'; SELECT * FROM JOBS WHERE myCol ='val3';
View Replies !
Sub Queries In Mysql?
Is there a way to do something like subqueries in one query? I have a customer table (Klant) with contacts (KlantKontakt) and a address (Adres) table. The address table keeps a record of each different address for a customer including old addresses (to maintain history). If I want to retrieve a list of customers with their newest address, I have to do a max() to retreive the last address. I can do this in PHP in a seperate query but I like to do it in one query on the mysql prompt. Code:
View Replies !
Multiple Queries W/ 4.0.x (C API)
When executing multiple queries, which return a result set, must mysql_free_result be called after retrieving each result set using mysql_store_result? My concern is that if the result was not freed after each retrieval, that perphaps it may impose a memory leak. Or, does MySql reuse previously allocated memory for subsequent result sets? My app performs several back-to-back select and select/insert queries. Just need to know how to handle this action.
View Replies !
!= Operator In Queries
I have a query with the following syntax to find students that haven't voted: SELECT * FROM Students WHERE Students.StudentID != Voted.StudentID The thing is, the results I'm getting are basically the same as if has just used 'SELECT * FROM Students' alone. The StudentID list of 'Voted' is shorter than that of 'Students', as some students haven't voted yet. Anyone know what I'm wording wrong here?
View Replies !
Combining Queries
How can I get this into one single query? I donot want to run one by one manually. Code: UPDATE TABLE1 SET title = '0' where title = ' ' UPDATE TABLE1 SET name = '0' where name = ' ' UPDATE TABLE1 SET book = '0' where book = ' ' UPDATE TABLE1 SET descr = '0' where descr = ' ' UPDATE TABLE1 SET code = '0' where code = ' '
View Replies !
Executing Queries
I am pretty new to MySql so please bear with me. I was wondering if it is possible to format your queries as a url which can then be run through a web browser. For example, lets say I have a string stored in a table is it possible to do something like this: http://myHost/myDatabase/Select myColum from myTable If that can be done will the result display on the screen?
View Replies !
Difference Between These 2 Queries
Code: select * from foo where (col1 or col2)='foo' and (col3 or col4)='blah' and select * from foo where (col1='foo' or col2='foo') and (col3='blah' or col4='blah') shouldnt they return the same set? or am i missing some logic here
View Replies !
Number Of Queries
My team is working on transfering old db data to mysql. Its been configured somehow where it caps at 1 type of query at a time. Anyway to increase this? At one point it did around 700 at one time, but some configuration messed this up, how can we incrase this?
View Replies !
Less Queries Or Less Data
is it better / faster to have rows that hold more data, (ie putting in a varchar username instead of an integer userID to save having to query another table to get the username) or is it better the other way around? (of course unless the username could be changing which in this application the username cannot be changed)
View Replies !
Some Date Queries
I need help writing a query that will pull results from the database that are dated this month.So I want to see all results for December this month and January next month ... and so on. The field name is 'date.
View Replies !
|