<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>MySQL Forums - Table Space</title>
        <description>Forum for Table Spaces</description>
        <link>http://forums.mysql.com/list.php?134</link>
        <lastBuildDate>Sat, 18 May 2013 10:52:45 +0000</lastBuildDate>
        <generator>Phorum 5.2.19</generator>
        <item>
            <guid>http://forums.mysql.com/read.php?134,586685,586685#msg-586685</guid>
            <title>Difference between theoretical and real storage size (no replies)</title>
            <link>http://forums.mysql.com/read.php?134,586685,586685#msg-586685</link>
            <description><![CDATA[ Hi,<br />
<br />
I'm wondering, where the difference between theoretical und real storage is coming from:<br />
<br />
For example: I have one table with only one row.<br />
The table has one integer-attribute (primary key) and ten VarChar(45) Attributes.<br />
In theoretical the size needed for the table would be the size of the integer and the size of the ten VarChar(45), as there is only one row.<br />
This would be: 4 Byte + 10 * (45Byte + 1 Byte) = 464 Bytes<br />
<br />
(The one extra Byte per VarChar is explained in the MySQL Reference about Data Types)<br />
<br />
If I run the following query, it says, that the size of the table is 466 Bytes:<br />
SELECT table_name AS 'Table', data_length 'Size' FROM information_schema.TABLES WHERE table_schema = 'inheritance' AND table_name = 'testtable'<br />
<br />
Does anyone know, where the two extra Bytes are coming from?<br />
<br />
I think this could be Meta-Data, the two Bytes could be pointers to the beginning of the row.<br />
Is there a reference about this?<br />
<br />
Thanks for your help]]></description>
            <dc:creator>Leo Kotschenreuther</dc:creator>
            <category>Table Space</category>
            <pubDate>Sat, 18 May 2013 09:38:28 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,583150,583150#msg-583150</guid>
            <title>Query to combine columns (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,583150,583150#msg-583150</link>
            <description><![CDATA[ Hi,<br />
I am new to MySql. Please help me out to solve this query.<br />
<br />
I need to combine two columns of data and insert in new column<br />
<br />
I have two columns -<br />
col1 col2<br />
1     2<br />
6     3<br />
8     1<br />
9     6<br />
<br />
Now I need the table to look like below - <br />
<br />
col1 col2 col3<br />
1     2    12<br />
6     3    63<br />
8     1    81<br />
9     6    96]]></description>
            <dc:creator>Harshada Thakur</dc:creator>
            <category>Table Space</category>
            <pubDate>Sat, 06 Apr 2013 04:20:36 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,578419,578419#msg-578419</guid>
            <title>creating a database inside a MySQL database (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,578419,578419#msg-578419</link>
            <description><![CDATA[ I have three MySQL Databases: db1, db2 and db3, which contains several tables.<br />
<br />
I want to have these database under two different schema or databases, test1 and test2.<br />
<br />
So that both test1 and test2 database has three databases each:<br />
 <br />
test1.db1, test1.db2 and test1.db3 AND<br />
<br />
test2.db1, test2.db2 and test3.db3<br />
<br />
This was done using tablespace in Oracle.<br />
<br />
How can I do this in MySQL?<br />
<br />
Need help..]]></description>
            <dc:creator>Akash Gupta</dc:creator>
            <category>Table Space</category>
            <pubDate>Tue, 05 Feb 2013 03:48:20 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,573646,573646#msg-573646</guid>
            <title>Table Key Question (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,573646,573646#msg-573646</link>
            <description><![CDATA[ I'm trying to learn about forum creation using this example.<br />
<a href="http://phpeasystep.com/phptu/12.html"  rel="nofollow">http://phpeasystep.com/phptu/12.html</a><br />
<br />
I have a primary key set w/auto increment on the 'create' table but am unsure how to set up the second table.  I need referential integrity but don't know that I NEED a primary key on the second table (which is for answers).<br />
<br />
Any thoughts on how I should set the second table key(s) through PHPmyAdmin ???<br />
<br />
TIA]]></description>
            <dc:creator>hris verland</dc:creator>
            <category>Table Space</category>
            <pubDate>Fri, 16 Nov 2012 02:06:18 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,568815,568815#msg-568815</guid>
            <title>How Mysql administrate memory? and what are the principal or master data bases? (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,568815,568815#msg-568815</link>
            <description><![CDATA[ Hello everybody, well I have a homework about the internal arquitectur of Mysql I know that Mysql has more than one type of engine, but my questions are speficly how mysql administrate memory, and the two master data base, I hear about mysql and information_schema, if you can bring me some information about it I'll thank you so much, or if you have a manual or something more specific than the oficial manual... It will help me a lot]]></description>
            <dc:creator>Jorge Mendez</dc:creator>
            <category>Table Space</category>
            <pubDate>Fri, 21 Sep 2012 03:41:35 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,557940,557940#msg-557940</guid>
            <title>Out of undo space (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,557940,557940#msg-557940</link>
            <description><![CDATA[ Hi,<br />
<br />
we are facing a problem concerning the undo space. We have a large table using a tablespace. When we are deleting entries from the table which uses the tablespace, the undo space is growing until we get:<br />
<br />
SQL Error: 1297, SQLState: HY000<br />
Got temporary error 1501 'Out of undo space' from NDBCLUSTER<br />
<br />
We are creating the LOGFILE GROUP with the following statements:<br />
<br />
CREATE LOGFILE GROUP LG_CMN_FREE <br />
ADD UNDOFILE 'undo_cmn_free_1.dat' <br />
INITIAL_SIZE 256M <br />
UNDO_BUFFER_SIZE 100M <br />
ENGINE NDB; <br />
<br />
ALTER LOGFILE GROUP LG_CMN_FREE <br />
ADD UNDOFILE 'undo_cmn_free_2.dat' <br />
INITIAL_SIZE 256M <br />
ENGINE NDB;<br />
<br />
<br />
The tablespace is generated with these staments:<br />
<br />
CREATE TABLESPACE ts_cmn_free<br />
ADD DATAFILE 'data_cmn_free_1.dat' <br />
USE LOGFILE GROUP LG_CMN_FREE <br />
EXTENT_SIZE = 32M<br />
INITIAL_SIZE = 16G<br />
ENGINE NDB; <br />
<br />
ALTER TABLESPACE ts_cmn_free <br />
ADD DATAFILE 'data_cmn_free_2.dat' <br />
INITIAL_SIZE = 16G<br />
ENGINE NDB; <br />
<br />
ALTER TABLESPACE ts_cmn_free <br />
ADD DATAFILE 'data_cmn_free_3.dat' <br />
INITIAL_SIZE = 16G<br />
ENGINE NDB;<br />
<br />
ALTER TABLESPACE ts_cmn_free <br />
ADD DATAFILE 'data_cmn_free_4.dat' <br />
INITIAL_SIZE = 16G<br />
ENGINE NDB;<br />
<br />
<br />
Finally we do the following to use the generated tablespace:<br />
<br />
ALTER TABLE `MeasurementData` TABLESPACE ts_cmn_free STORAGE DISK ENGINE NDBCLUSTER;<br />
<br />
<br />
We thought, when deleting data from the table which uses the tablespace the used undo space must also shrink. But the undo space is growing until we get the described error.<br />
<br />
Can somebody help?<br />
<br />
Thx]]></description>
            <dc:creator>Georg Kompacher</dc:creator>
            <category>Table Space</category>
            <pubDate>Wed, 20 Jun 2012 01:59:54 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,537050,537050#msg-537050</guid>
            <title>Query database to return tables matching column &quot;column&quot; (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,537050,537050#msg-537050</link>
            <description><![CDATA[ Is there a capability equivalent to: <br />
SHOW TABLES FROM mydb WHERE COLUMN_NAME = &quot;my column&quot;<br />
?]]></description>
            <dc:creator>Phillip Harris</dc:creator>
            <category>Table Space</category>
            <pubDate>Sun, 20 May 2012 14:57:56 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,526092,526092#msg-526092</guid>
            <title>Ordering second column dependant upon first (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,526092,526092#msg-526092</link>
            <description><![CDATA[ Consider the folowing:<br />
SELECT user.name, SUM(pts) as total_points FROM points INNER JOIN user ON (points.knytroID = user.id) GROUP BY knytroID ORDER BY total_points DESC;<br />
<br />
I would like to have a second column order by which 'knytroID' got the total_points value first. If I remove DESC from the statement, I preserve the order of which ID gets the points first because each entry in points is depentand upon time. However, when I add DESC, is seems to reverse the table before calculating SUM and changes the order.]]></description>
            <dc:creator>Milton Griggs</dc:creator>
            <category>Table Space</category>
            <pubDate>Fri, 20 Apr 2012 04:52:54 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,520660,520660#msg-520660</guid>
            <title>Compare 2 colums (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,520660,520660#msg-520660</link>
            <description><![CDATA[ Hello i'm new with mysql and i want to compare two columns from the same table<br />
and if Colum1 is diferent than colum2 , delete the record<br />
<br />
it's possible? thanks! and sorry for my english :(]]></description>
            <dc:creator>federico chel</dc:creator>
            <category>Table Space</category>
            <pubDate>Thu, 22 Mar 2012 17:12:36 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,504855,504855#msg-504855</guid>
            <title>Large table - to segment or not (3 replies)</title>
            <link>http://forums.mysql.com/read.php?134,504855,504855#msg-504855</link>
            <description><![CDATA[ Hi,<br />
<br />
I have a table called clients, which is about 103,000 records, all text and numbers -- no binary or anything huge.  Only about 3000 records are actually clients per se -- the rest are &quot;potential clients&quot;.  I inherited the DB from the last developer as an Access DB with two tables for this -- clients and marketing and there was code to synchronize changes to clients to the marketing table and vice versa.  I have redesigned the DB (as MySQL) and felt it better to simply put them all in one table and have a tinyint(1) field to indicate whether they are real clients or marketing.<br />
<br />
Was this a bad idea?  Should I have created two tables and move records between them when marketing records become clients?  It seems to me that the original design where there were duplicates between the tables goes against good practice.  The business requirement that was specified by the client is that the two sets of data must remain in sync, otherwise I would recommend simply keeping them separate and not sweating the changes -- marketing is imprecise anyway, but it's not my call.<br />
<br />
My design seemed fine until executing the following query:<br />
SELECT id, name, address, city, state, zip, county, client, flag FROM clients WHERE id IN (SELECT client_id FROM contacts WHERE email LIKE '%test@abc.org%') ORDER BY name ASC<br />
This query chokes the mysql server.<br />
<br />
I was able to improve the response by adding the following condition to the WHERE clause and building an index on clients.client (the tinyint(1) field that determines whether record is a real client or not):<br />
client=1<br />
so the  new query is:<br />
SELECT id, name, address, city, state, zip, county, client, flag FROM clients WHERE id IN (SELECT client_id FROM contacts WHERE client=1 AND email LIKE '%test@abc.org%') ORDER BY name ASC<br />
<br />
Now the query does return a result, but takes almost 10 seconds on my local test server.  I fear that this could still be problematic, especially on web host's server.<br />
<br />
Any help would be appreciated.<br />
<br />
Thank you,<br />
<br />
JP]]></description>
            <dc:creator>JP Howlett</dc:creator>
            <category>Table Space</category>
            <pubDate>Mon, 12 Dec 2011 18:15:27 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,433030,433030#msg-433030</guid>
            <title>sorting by values from joined table (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,433030,433030#msg-433030</link>
            <description><![CDATA[ Hello,<br />
<br />
I have two tables. First contains info about some tasks - task id , task due time, task description and id of user assigned to this task. Second table contains user info user id , user email, user name etc. <br />
<br />
I want to display info from both tables and be able to sort the results by columns from both tables. What kind of join i need? Do I need some kind of group or union? <br />
<br />
Please help.<br />
Thanks in advance.]]></description>
            <dc:creator>Łukasz Korona</dc:creator>
            <category>Table Space</category>
            <pubDate>Wed, 07 Sep 2011 01:30:49 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,432947,432947#msg-432947</guid>
            <title>table implicitly not unlocking (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,432947,432947#msg-432947</link>
            <description><![CDATA[ some times when a table is locked implicitly during insert,update or delete operation.Then the table is locked for long time unless you unlock it explicitly. Then it is getting difficult to run dml statement on that table.<br />
<br />
Can any one let me know Why this is happening ?]]></description>
            <dc:creator>ragen sol</dc:creator>
            <category>Table Space</category>
            <pubDate>Wed, 07 Sep 2011 01:31:34 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,429646,429646#msg-429646</guid>
            <title>Tablespace Usage (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,429646,429646#msg-429646</link>
            <description><![CDATA[ Can someone please tell me, how to find the total Tablespace allocated and how much is used. I'm using mysql 5.0<br />
<br />
This is what I see, when I do show variables like 'innodb_data_file_path';<br />
ibdata1:300M;ibdata2:300M;ibdata3:300M;ibdata4:300M;ibdata5:300M;ibdata6:300M;ibdat73:300M;ibdata8:300M;ibdata9:300M;ibdata10:300M;ibdata11:300M;ibdata12:300M;ibdata13:300M;<br />
<br />
So as per, 3.8G Tablespace is allocated, but to calculate, how much is used<br />
       <br />
<br />
Thanks,<br />
katie]]></description>
            <dc:creator>katie c</dc:creator>
            <category>Table Space</category>
            <pubDate>Sun, 07 Aug 2011 18:25:51 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,416817,416817#msg-416817</guid>
            <title>file per table and data directory (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,416817,416817#msg-416817</link>
            <description><![CDATA[ hi,<br />
<br />
i am using this syntax trying to create tabel on SSD Disk,<br />
the statement completed successfully but i cant see the file under the data directory.<br />
do i have to enable the file per table option first ?<br />
<br />
statement :<br />
&quot;<br />
create table NewTbl<br />
like OldTbl; DATA DIRECTORY='/mntr/daily', INDEX DIRECTORY='/mntr/daily'<br />
&quot;<br />
<br />
Thanks,<br />
<br />
Cman.]]></description>
            <dc:creator>Cman Pr</dc:creator>
            <category>Table Space</category>
            <pubDate>Tue, 19 Apr 2011 03:12:37 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,416313,416313#msg-416313</guid>
            <title>select statment  from to table (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,416313,416313#msg-416313</link>
            <description><![CDATA[ select  data from t1.col1 there are not in t2.col1 <br />
<br />
So if : <br />
<br />
<br />
 1             2<br />
 2             4<br />
 3            <br />
 4<br />
 5<br />
____          ____<br />
t1.col1       t2.col1<br />
<br />
<br />
result  will be is  :<br />
1<br />
3<br />
5<br />
I want  select statement  to do that ???!!!<br />
Any help would be greatly appreciated.<br />
Thanks in advance.]]></description>
            <dc:creator>selly M.Ail</dc:creator>
            <category>Table Space</category>
            <pubDate>Sat, 16 Apr 2011 04:39:16 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,414518,414518#msg-414518</guid>
            <title>Composite Primary Keys - Control auto_increment (2 replies)</title>
            <link>http://forums.mysql.com/read.php?134,414518,414518#msg-414518</link>
            <description><![CDATA[ Dear Members<br />
<br />
I have the follow table definition <br />
( I need work mandatory with ENGINE=InnoDB due transactions control)<br />
<br />
CREATE TABLE item (<br />
 idItem bigint(20) unsigned NOT NULL auto_increment,<br />
 idArticulo bigint(20) unsigned NOT NULL ,<br />
 texto varchar(40),<br />
  PRIMARY KEY (idItem,idArticulo)<br />
)ENGINE=InnoDB;<br />
<br />
consider idArticulo like the PK from a Master table<br />
Therefore Articulo (Master Table, Father) and Item (Sub Master Table, child)<br />
<br />
Here to fill with simple data <br />
<br />
insert into item(idArticulo,texto)values(1,'one');<br />
insert into item(idArticulo,texto)values(1,'two');<br />
insert into item(idArticulo,texto)values(1,'three');<br />
<br />
insert into item(idArticulo,texto)values(2,'one');<br />
insert into item(idArticulo,texto)values(2,'two');<br />
insert into item(idArticulo,texto)values(2,'three');<br />
<br />
If I do the follow query, I get<br />
<br />
mysql&gt; select idarticulo,iditem,texto from item order by iditem,idarticulo;<br />
+------------+--------+-------+<br />
| idarticulo | iditem | texto |<br />
+------------+--------+-------+<br />
|          1 |      1 | one   |<br />
|          1 |      2 | two   |<br />
|          1 |      3 | three |<br />
|          2 |      4 | one   |<br />
|          2 |      5 | two   |<br />
|          2 |      6 | three |<br />
+------------+--------+-------+<br />
6 rows in set (0.00 sec)<br />
<br />
mysql&gt;<br />
<br />
Realize yourself that iditem is 1,2,3,4,5,6<br />
<br />
I want some way, I dont care if is necessary edit the table, to get something like this (desired output) when I insert my items (child table)<br />
<br />
+------------+--------+-------+<br />
| idarticulo | iditem | texto |<br />
+------------+--------+-------+<br />
|          1 |      1 | one   |<br />
|          1 |      2 | two   |<br />
|          1 |      3 | three |<br />
|          2 |      1 | one   |<br />
|          2 |      2 | two   |<br />
|          2 |      3 | three |<br />
+------------+--------+-------+<br />
<br />
Realize yourself that iditem is 1,2,3 and 1,2,3 according for each idarticulo<br />
<br />
I mean, each Master table (for each PK) has <br />
its own control from its childs (for its FK)<br />
<br />
Please I need a way to work in this, I would have 3 buildings/local in different places on my city working in real time, I need strict control for this generation for the fields, I assume that MySQL latest versions perhaps would handle this situation<br />
<br />
Thanks in advance]]></description>
            <dc:creator>Dr Pompeii</dc:creator>
            <category>Table Space</category>
            <pubDate>Tue, 05 Apr 2011 18:23:49 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,397301,397301#msg-397301</guid>
            <title>Create Composite Primary Key Errors (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,397301,397301#msg-397301</link>
            <description><![CDATA[ I've been trying unsuccessfully to create a composite primary key. I've tried several different methods, all with the same or similar error messages: &quot;Error 1068 (42000) multiple primary keys defined&quot;. (I'm using MySQL &quot;Server version: 5.1.42-community MySQL Community Server (GPL)&quot;). I've tried the following command syntax:<br />
<br />
<br />
1.  To create a composite key at the time of table creation -<br />
<br />
    CREATE TABLE table1<br />
    (key1 CHAR(#),<br />
    key2 CHAR(#),<br />
    key3 (CHAR(#),<br />
    PRIMARY KEY(key1, key2));<br />
<br />
2.  To create a composite key after-the-fact (no primary key specified when table created) -<br />
<br />
    ALTER TABLE (tablename)<br />
    ADD PRIMARY KEY(key1, key2);<br />
    <br />
    I also tried...<br />
<br />
    ALTER TABLE (tablename)<br />
    ADD PRIMARY KEY(key1);<br />
    [and then ran it again for &quot;key2&quot;]<br />
<br />
3.  I tried not including the key1 and key2 attributes at the time of table creation, and instead using both of the two previous commands (not at the same time) to add the new attribute to the table along with its Primary Key status, as indicated in item 2 above.<br />
<br />
<br />
All of these methods failed! I read that its definitely possible to do. So, I wonder if there's some bug or problem with my software version that doesn't allow composite keys to be created for some reason?. Has anyone got a clue what's wrong here, or how to fix the problem? I'm relatively new to MySQL.<br />
<br />
Thanks!]]></description>
            <dc:creator>Robert Walden</dc:creator>
            <category>Table Space</category>
            <pubDate>Sun, 05 Dec 2010 19:22:04 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,397263,397263#msg-397263</guid>
            <title>How to present a table with partly fixed values to the user (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,397263,397263#msg-397263</link>
            <description><![CDATA[ Recently I wanted to have a configuration table in my app. Some of the items should be configurable (editable) only by the administrator, others also by other staff (users). For a simpler application logic all configuration should go into one table.<br />
The solution was using different column privileges. <br />
Now in the config table there is one column for the actual value, one for the default value and one saying if this is a user-editable item. All users except the admin may only edit the &quot;actual value&quot; column. And a trigger resets the actual value before updating to the default value if the item is not user-editable, so that in effect normal users cannot edit protected rows. Normal users may only select and update unprotected rows, not delete and insert.<br />
This amounts to having sort of table spaces where certain users can only access or update certain rows. I wonder if there is a more &quot;natural&quot; way to achieve this in MySQL.<br />
The nice thing about this is that I can trust the users now with any sort of interface tools - command line, Navicat, Heidi, my app - without having fear of them ruining the configuration.]]></description>
            <dc:creator>a b</dc:creator>
            <category>Table Space</category>
            <pubDate>Sun, 05 Dec 2010 19:18:21 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,396520,396520#msg-396520</guid>
            <title>Indexes on Text Fields (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,396520,396520#msg-396520</link>
            <description><![CDATA[ I'm not sure if it's the correct forum, but I could find nothing else.<br />
<br />
The thing is, when I try to create an index on a field of a string type, I sometimes get this error:<br />
<br />
#1170 - BLOB/TEXT column '(...)' used in key specification without a key length<br />
<br />
What's that? Is there any way to avoid it?]]></description>
            <dc:creator>?! ?!</dc:creator>
            <category>Table Space</category>
            <pubDate>Mon, 29 Nov 2010 15:20:34 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,396407,396407#msg-396407</guid>
            <title>Seeking opinion on table design (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,396407,396407#msg-396407</link>
            <description><![CDATA[ i have a module where there are some 8-9 table referencing a single parent table. should i go for junction table having the relations between the primary key of the master table and all the primary keys of  the referencing tables.<br />
<br />
is a junction table necessary or we can do without it. Which one is better with or without. <br />
these are all InnoDB tables<br />
<br />
this is the master to all table<br />
<br />
p_t_all(<br />
slt__cd int primary key,<br />
dy_code int foreign key,<br />
slt_id int foreign key<br />
)<br />
<br />
<br />
Tables those are                     <br />
t1(<br />
ds_id int primary key,<br />
slt_cd int foreign key,<br />
dfc_id forign key,<br />
)<br />
.......<br />
.......<br />
.......<br />
<br />
junctio table is <br />
<br />
jt(<br />
slt_cd int,<br />
ds_id int,<br />
tpf_id int,<br />
tpf1_id int,<br />
tpsb_id int,<br />
tpspl_id,<br />
primary key(slt_cd,ds_id,tpf_id,tpf1_id,tpsb_id,tpspl_id,)<br />
)<br />
engine= InnoDB;<br />
<br />
Should I go for it or not?]]></description>
            <dc:creator>ragen sol</dc:creator>
            <category>Table Space</category>
            <pubDate>Mon, 29 Nov 2010 15:43:13 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,384914,384914#msg-384914</guid>
            <title>Write to two tables from one page (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,384914,384914#msg-384914</link>
            <description><![CDATA[ hi, is it possible to write different data to two different tables that is on one database?<br />
<br />
ie:<br />
$sql=&quot;insert into my_1st_tbl (id, date, status)<br />
$sql=&quot;insert into my_2nd_tbl (id, reason, amount)]]></description>
            <dc:creator>Petro Smit</dc:creator>
            <category>Table Space</category>
            <pubDate>Sat, 11 Sep 2010 18:59:09 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,384108,384108#msg-384108</guid>
            <title>information_schema update_time (2 replies)</title>
            <link>http://forums.mysql.com/read.php?134,384108,384108#msg-384108</link>
            <description><![CDATA[ Hi,<br />
<br />
I'm currently workin on a application for multiple users which uses mysql.<br />
The application should be able to determine whether a client has the most recent version of the data in the application. Basically I want want to check if someone else committed updates and then download them.<br />
<br />
Therefore I want to use the update_time value in the incormation_schema table. And compare it to the last time a client downloaded the data from the DB.<br />
<br />
The problem is that the update_time field is not always set when I perform operations on the table. Does it only react to certain actions or is this some sort of bug?<br />
<br />
Thanks for your help]]></description>
            <dc:creator>Fabian Gampfer</dc:creator>
            <category>Table Space</category>
            <pubDate>Tue, 07 Sep 2010 11:04:07 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,380959,380959#msg-380959</guid>
            <title>GROUP BY SHOW ALL DISTINCT COLUMNS (3 replies)</title>
            <link>http://forums.mysql.com/read.php?134,380959,380959#msg-380959</link>
            <description><![CDATA[ mysql&gt; select * from products;<br />
+---------+-------------+-----------+------+<br />
| prod_id | prod_source | prod_type | flag |<br />
+---------+-------------+-----------+------+<br />
|       1 | USA         |         2 |    0 |<br />
|       2 | USA         |         2 |    0 |<br />
|       3 | USA         |         2 |    0 |<br />
|       4 | USA         |         3 |    1 |<br />
|       5 | USA         |         4 |    1 |<br />
|       6 | BRA         |         1 |    1 |<br />
|       7 | BRA         |         2 |    1 |<br />
+---------+-------------+-----------+------+<br />
<br />
<br />
<br />
Required resulset<br />
==================<br />
+-----------+----------+<br />
| prod_type | count(*) |<br />
+-----------+----------+<br />
|         2 |        3 |<br />
|         3 |        0 |<br />
|         4 |        0 |<br />
+-----------+----------+<br />
<br />
<br />
where condition<br />
	prod_source = USA<br />
	flag=0<br />
<br />
<br />
but the resultset i'm getting is <br />
<br />
+-----------+----------+<br />
| prod_type | count(*) |<br />
+-----------+----------+<br />
|         2 |        3 |<br />
+-----------+----------+<br />
<br />
<br />
with the query   SELECT prod_type ,count(*) <br />
			FROM products<br />
			WHERE prod_source='USA'  and flag=0  <br />
			GROUP by prod_type <br />
			ORDER by prod_type;<br />
<br />
<br />
HOW do i get the resulset with count of all the prod_type's in USA ? It must display all the prod_type's in USA even if the count is 0 .<br />
<br />
<br />
<br />
<br />
<br />
<br />
TABLE DEFINITION<br />
===================<br />
<br />
CREATE TABLE `products` (<br />
  `prod_id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,<br />
  `prod_source` VARCHAR(45) NOT NULL,<br />
  `prod_type` INTEGER UNSIGNED NOT NULL,<br />
  `flag` INTEGER UNSIGNED NOT NULL,<br />
  PRIMARY KEY (`prod_id`)<br />
)<br />
ENGINE = InnoDB;<br />
<br />
<br />
DATA INSERTION<br />
===============<br />
<br />
INSERT INTO `products` VALUES (1,'USA',2,0),(2,'USA',2,0),(3,'USA',2,0),(4,'USA',3,1),(5,'USA',4,1),(6,'BRA',1,1),(7,'BRA',2,1);]]></description>
            <dc:creator>ajoe joseph</dc:creator>
            <category>Table Space</category>
            <pubDate>Tue, 07 Sep 2010 12:18:09 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,378027,378027#msg-378027</guid>
            <title>displaying images from your DB (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,378027,378027#msg-378027</link>
            <description><![CDATA[ Hi all<br />
I’m trying to insert and display an art gallery on a web page from my mysql DB. I would like the user to check the art they would like, using the (check box and submit button that would be available) have it post and be entered into my DB as an order. How do I insert the art into the DB and retrieve it to fill the order. This is a ColdFusion page. And yes, I am new to all this. Thanks so much :)]]></description>
            <dc:creator>lee Green</dc:creator>
            <category>Table Space</category>
            <pubDate>Tue, 07 Sep 2010 11:47:51 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,377348,377348#msg-377348</guid>
            <title>Need suggestion on table issue (1 reply)</title>
            <link>http://forums.mysql.com/read.php?134,377348,377348#msg-377348</link>
            <description><![CDATA[ Currently i am working on one show management site.I just need some suggestion regarding designing of the database(Tables).The basic scenario is like this,<br />
<br />
Basically the site is about casting for a show in which Casting company will generate show and the users would apply for the show.<br />
I made one table called 'shows' which stores all the basic details for show(e,g name,description,date,image).<br />
Now i have to develope one module which generates questions dynamically for the registration form of the show which users would fill up at the time of registration.<br />
<br />
Currently i have two choice.<br />
<br />
1.Either i can make a new table for every show and store the answer of the users.<br />
<br />
Table Schema:show_1(Table name)<br />
<br />
id<br />
user_id<br />
question_1<br />
question_2<br />
question_3<br />
<br />
show_2(Table name)<br />
<br />
id<br />
user_id<br />
question_4<br />
question_5<br />
question_6<br />
<br />
2.I store the answers by concating them to make one string and then store it into <br />
the 'user_show_mapping' table.<br />
<br />
Could anyone suggest me which is the best option to choose and why?<br />
<br />
Is there any performance issue exist with the more number of tables in the database?]]></description>
            <dc:creator>Saumil Shah</dc:creator>
            <category>Table Space</category>
            <pubDate>Tue, 07 Sep 2010 11:58:06 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,374891,374891#msg-374891</guid>
            <title>big table (4 replies)</title>
            <link>http://forums.mysql.com/read.php?134,374891,374891#msg-374891</link>
            <description><![CDATA[ I have created a very large table with over 2500 fields in it, and I get an error message when I try to create the table saying that I have too many columns.  I have come up with a logical way to break the table into four tables, but one of those tables (with approx. 1000 fields) still won’t create.  I am not seeing any logical way to break up this table, since my script runs a loop which loops through all those fields.  The limit for fields in a MySQL table is supposed to be 4096, so I created a test script to create a table with as many fields as I can squeeze into it.  bit(1) is the smallest possible size for a field (right?), so I made all my fields bit(1), but the script will only create a table with (exactly!) 1000 fields.  It fails if I try to create 1001 bit(1) fields in a table.  (The actual table in my program is mostly bit(1) fields, but also has some bit(3) fields.)  If 4096 is the limit, shouldn’t I be able to get 4096 fields if I am using the smallest field size possible?  If I can’t increase the number of fields to the number I need, is there any way to work around this problem, given that I need to run a loop using all the data?]]></description>
            <dc:creator>Ward Ricker</dc:creator>
            <category>Table Space</category>
            <pubDate>Wed, 07 Jul 2010 21:03:39 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,374342,374342#msg-374342</guid>
            <title>Need a Help (6 replies)</title>
            <link>http://forums.mysql.com/read.php?134,374342,374342#msg-374342</link>
            <description><![CDATA[ Can any one help me on this<br />
<br />
I have a table with date coloumn and an amount column. I am storing the extracted amount in the amount column i.e the outstanding amount.<br />
<br />
i need to fetch the last date value of every month, can any one help on this?]]></description>
            <dc:creator>Raj Shekar</dc:creator>
            <category>Table Space</category>
            <pubDate>Tue, 06 Jul 2010 15:02:44 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,373281,373281#msg-373281</guid>
            <title>Not able to see any data in table FILES.INFORMATION_SCHEMA (2 replies)</title>
            <link>http://forums.mysql.com/read.php?134,373281,373281#msg-373281</link>
            <description><![CDATA[ Hello DBAs<br />
<br />
Basically I am a Oracle DBA and new in MySQL DBA job. I am facing prblem as follows:-<br />
<br />
When I am trying to check the metadata about the files of MySQL from table FILES.INFORMATION_SCHEMA, It is showing no rows. <br />
<br />
-----------------------------------------------<br />
mysql&gt; use information_schema<br />
Reading table information for completion of table and column names<br />
You can turn off this feature to get a quicker startup with -A<br />
<br />
Database changed<br />
mysql&gt; select count(*) from files;<br />
+----------+<br />
| count(*) |<br />
+----------+<br />
|        0 |<br />
+----------+<br />
1 row in set (0.00 sec)<br />
<br />
mysql&gt;<br />
mysql&gt;<br />
-----------------------------------------------<br />
<br />
Can some please help me, why it is happening... <br />
<br />
Thanks <br />
-Naveen]]></description>
            <dc:creator>Naveen Gangil</dc:creator>
            <category>Table Space</category>
            <pubDate>Tue, 07 Sep 2010 04:51:52 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,370837,370837#msg-370837</guid>
            <title>Strange/Scary UPDATE issue (2 replies)</title>
            <link>http://forums.mysql.com/read.php?134,370837,370837#msg-370837</link>
            <description><![CDATA[ Hi all,<br />
<br />
I have a strange issue with one query:<br />
<br />
UPDATE aur_Projects set Status='Completed' WHERE ProjectId='1750';<br />
<br />
as you can see....maybe the simplest query on the planet! the problem is that the query is setting to 0 another field (and only this one):<br />
<br />
select ID_TEAM from aur_Projects where ProjectId='1750';<br />
<br />
result:<br />
ID_TEAM = 0<br />
<br />
<br />
I've tested this from the shell command, it is not related to anything else I wrote!!<br />
<br />
I've tried copying the table, rename it to aur_Projects2 and the issue dissapear!<br />
<br />
This is the table:<br />
<br />
CREATE TABLE IF NOT EXISTS `aur_Projects` (<br />
  `ProjectId` int(11) NOT NULL auto_increment,<br />
  `ProjectNumber` varchar(100) NOT NULL,<br />
  `DateCreated` datetime NOT NULL,<br />
  `Description` text,<br />
  `Status` varchar(100) NOT NULL,<br />
  `IsActive` enum('no','yes') NOT NULL default 'yes',<br />
  `ProjectNumber` varchar(100) default NULL,<br />
  `BidId` int(10) NOT NULL,<br />
  `RegisteredDate` date NOT NULL,<br />
  `EndDate` date default NULL,<br />
  `ContactId` int(11) NOT NULL,<br />
  `ID_WORKGROUP` int(11) NOT NULL,<br />
  `ID_LOCATION` int(11) NOT NULL,<br />
  `PATH_FOLDER` varchar(100) NOT NULL,<br />
  `archive_id_location` int(11) NOT NULL,<br />
  `archive_tape_id` varchar(500) NOT NULL,<br />
  `ID_TEAM` int(11) NOT NULL,<br />
  PRIMARY KEY  (`ProjectId`)<br />
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2058 ;<br />
<br />
any idea?]]></description>
            <dc:creator>Luca Rondanini</dc:creator>
            <category>Table Space</category>
            <pubDate>Tue, 07 Sep 2010 12:23:25 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?134,363880,363880#msg-363880</guid>
            <title>Requeriment logic with Composite Primary Keys (8 replies)</title>
            <link>http://forums.mysql.com/read.php?134,363880,363880#msg-363880</link>
            <description><![CDATA[ Dear Members<br />
<br />
I have the follow table definition<br />
					<br />
CREATE TABLE item (<br />
 idItem bigint(20) unsigned NOT NULL auto_increment,<br />
 idArticulo bigint(20) unsigned NOT NULL ,<br />
 texto varchar(40),<br />
  PRIMARY KEY (idItem,idArticulo)<br />
)ENGINE=InnoDB;<br />
<br />
consider idArticulo like the PK from a Master table<br />
Therefore Articulo (Master Table, Father) and Item (Sub Master Table, child)<br />
<br />
Here to fill with simple data <br />
<br />
insert into item(idArticulo,texto)values(1,'one');<br />
insert into item(idArticulo,texto)values(1,'two');<br />
insert into item(idArticulo,texto)values(1,'three');<br />
<br />
insert into item(idArticulo,texto)values(2,'one');<br />
insert into item(idArticulo,texto)values(2,'two');<br />
insert into item(idArticulo,texto)values(2,'three');<br />
<br />
If I do the follow query, I get<br />
<br />
mysql&gt; select idarticulo,iditem,texto from item order by iditem,idarticulo;<br />
+------------+--------+-------+<br />
| idarticulo | iditem | texto |<br />
+------------+--------+-------+<br />
|          1 |      1 | one   |<br />
|          1 |      2 | two   |<br />
|          1 |      3 | three |<br />
|          2 |      4 | one   |<br />
|          2 |      5 | two   |<br />
|          2 |      6 | three |<br />
+------------+--------+-------+<br />
6 rows in set (0.00 sec)<br />
<br />
mysql&gt;<br />
<br />
I want some way, if is necessary edit the table no problem, to get something like this (desired output)<br />
<br />
+------------+--------+-------+<br />
| idarticulo | iditem | texto |<br />
+------------+--------+-------+<br />
|          1 |      1 | one   |<br />
|          1 |      2 | two   |<br />
|          1 |      3 | three |<br />
|          2 |      1 | one   |<br />
|          2 |      2 | two   |<br />
|          2 |      3 | three |<br />
+------------+--------+-------+<br />
<br />
I mean, each Master table has its own control from its childs<br />
I need this solution to apply too for warehouse documentation control, something like<br />
<br />
+------------+------------------+-------+<br />
| series     | warehouse-number | type  |<br />
+------------+------------------+-------+<br />
|          1 |     	      1 | in    |<br />
|          1 |     	      2 | out   |<br />
|          1 |   	      3 | in    |<br />
|          2 | 	              1 | out   |<br />
|          2 |   	      2 | out   |<br />
|          2 |  	      3 | out   |<br />
+------------+------------------+-------+<br />
<br />
Thanks in advanced for your guidance]]></description>
            <dc:creator>Dr Pompeii</dc:creator>
            <category>Table Space</category>
            <pubDate>Sun, 09 May 2010 05:19:22 +0000</pubDate>
        </item>
    </channel>
</rss>
