Re: Lookup tables

2008-08-01 Thread Perrin Harkins
On Fri, Aug 1, 2008 at 7:32 AM, Rudolf Lippan <[EMAIL PROTECTED]> wrote:
> How would you get duplicated data?  In one case you have an integer
> and in the other you have the value, but you still have to store one token
> of information with the row.

I meant in the case of storing the value directly in the column, with
the lookup table just used for enforcing a constraint on legal values.

- Perrin

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Lookup tables

2008-08-01 Thread Rudolf Lippan


On Thu, 31 Jul 2008 13:57:07 -0400, "Perrin Harkins" <[EMAIL PROTECTED]>
wrote:
> On Thu, Jul 31, 2008 at 12:59 PM, Chris W <[EMAIL PROTECTED]> wrote:
>> So my question is, is doing that way better than making the query more
>> complex with all the joins?
> 
> If by "better" you mean "faster" then yes, it probably is marginally
> faster.  It would be simpler to just use the actual values you want in
> the lookup columns rather than integers.  It might slow down writes a
> little (since the foreign key lookup would be a string instead of an
> integer) but it eliminates joins for reading.  The downside is
> duplicated data.

Hi Perrin,

 How would you get duplicated data?  In one case you have an integer
and in the other you have the value, but you still have to store one token
of information with the row.  And if you think about it, say for the case
of state code, it would take 16 bits to store the two letter state code vs.
16/32/64+ bits to store the lookup integer (assuming that you used char(2)
(8bit chars) and integer columns).


-r


 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Table aliasing

2008-08-01 Thread Richard Heyes
> I think what you want is "CREATE VIEW test.v AS SELECT * FROM t;"

That will do the job, thank you.

-- 
Richard Heyes
http://www.phpguru.org

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Table aliasing

2008-08-01 Thread Martijn Tonies
>I think what you want is "CREATE VIEW test.v AS SELECT * FROM t;"
>
>http://dev.mysql.com/doc/refman/5.0/en/create-view.html


Good one Ed, simple views are updateable, so that would work
for DML as well.

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Table aliasing

2008-08-01 Thread emierzwa
I think what you want is "CREATE VIEW test.v AS SELECT * FROM t;" 

http://dev.mysql.com/doc/refman/5.0/en/create-view.html

Ed

-Original Message-
From: Martijn Tonies [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 01, 2008 6:34 AM
To: mysql@lists.mysql.com
Subject: Re: Table aliasing

Hello Richard,

> Is there a way in MySQL to define an alias for a table, so in effect
> it has two names? For migration purposes.

No, it does not support aliasses.

But I think you could use the "merge storage engine" to do pretty
much the same, have a look here:

http://dev.mysql.com/doc/refman/5.1/en/merge-storage-engine.html


Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB,
Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Table aliasing

2008-08-01 Thread Martijn Tonies
Hello Richard,

> Is there a way in MySQL to define an alias for a table, so in effect
> it has two names? For migration purposes.

No, it does not support aliasses.

But I think you could use the "merge storage engine" to do pretty
much the same, have a look here:

http://dev.mysql.com/doc/refman/5.1/en/merge-storage-engine.html


Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Replication error 1236

2008-08-01 Thread Olaf Stein
Hi All,

Once a week or so I get the following error:


080801  8:18:35 [ERROR] Error reading packet from server: error reading log
entry ( server_errno=1236)
080801  8:18:35 [ERROR] Got fatal error 1236: 'error reading log entry' from
master when reading data from binary log

Stopping the slave and restart at its current postion does not help here
(the same error happens again with next entry in bin log), the only way I
know how to fix this is to flush the logs and restart the slave with the new
log file (changes in between are manually synched).

I would appreciate any pointers about where to start looking for the
problem. E.g. is the bin log file corrupt? And if so why does this happen so
often

Thanks
Olaf



- Confidentiality Notice:
The following mail message, including any attachments, is for the
sole use of the intended recipient(s) and may contain confidential
and privileged information. The recipient is responsible to
maintain the confidentiality of this information and to use the
information only for authorized purposes. If you are not the
intended recipient (or authorized to receive information for the
intended recipient), you are hereby notified that any review, use,
disclosure, distribution, copying, printing, or action taken in
reliance on the contents of this e-mail is strictly prohibited. If
you have received this communication in error, please notify us
immediately by reply e-mail and destroy all copies of the original
message. Thank you.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: SET vs. ENUM

2008-08-01 Thread Martijn Tonies


> Hello Jerry and Martijn
>
> sets contains an iterator so you can iterate thru the objects
> also supports the contains method set.contains("new String("foo"))
> http://www.docjar.com/docs/api/java/util/Set.html
>
> Enums must use the exact index and are generally use for fixed constant
> Array
> http://java.sun.com/j2se/1.5.0/docs/guide/language/enums.html

I fail to see what this has to do with MySQL?

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Table aliasing

2008-08-01 Thread Richard Heyes
No, the net effact would be that the table would have two names.

-- 
Richard Heyes
http://www.phpguru.org

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Table aliasing

2008-08-01 Thread Ranjeet Walunj

Richard Heyes wrote:

Is there a way in MySQL to define an alias for a table, so in effect
it has two names? For migration purposes.
  

What exactly do you mean by migration process ?

Do you want to take backup of older tables/databases ?

There are multiple ways of doing the same :

1) use mysqldump
2) mysqlhotcopy
3) use COPY TABLE command to create duplicated tables
4) Set up replication on another server/machine for taking backup
And many other ways ..

Regards,
Ranjeet Walunj


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Table aliasing

2008-08-01 Thread Richard Heyes
Hi,

Is there a way in MySQL to define an alias for a table, so in effect
it has two names? For migration purposes.

Thanks.

-- 
Richard Heyes
http://www.phpguru.org

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]