Re: QueryBrowser 1.1.1 - edit fields
"Michael G. Zinner" <[email protected]>
| Newsgroups | gmane.comp.db.mysql.mycc |
|---|---|
| Organization | MySQL AB |
| Message-ID | <[email protected]> |
Hi all, As soon as the server will support client side cursors, even an update in this table will work in QB: +-------+ |Data1 | +-------+ | 1 | | 1 | | 2 | | 1 | +-------+ Never the less, it is a good practice to have a primary key on *every* table you create. And it is also a good practice to always have an integer primary key - even when you would have unique char column - because this speeds up joins a lot. Using an extra integer column will need slightly more space, but it is worth it in 95% of the cases. That is the reason why we suggest the first column of a table being a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY named "id<tablename>" (if you enter the table name and press [Enter]) Another nice thing with client side cursors will be, that we can fetch data "on-demand". That means, if you do a SELECT * FROM log_entry and your log_entry table has a million rows, we will only fetch the first rows that fits onto the screen, e.g. 30. And if one scrolls down, we fetch another 30. Or if you jump to the end, we will only fetch the last 30... you get the idea. There are a lot of exciting new feature coming up in the server and we will keep the GUI tools up-to-date. Best regards, Mike Adam Majer wrote: > Raphael Matthias Krug wrote: > > >>Hi Adam, >> >>one stupid question. What difference does it make in your example, if >>this one columne has a primary key? >> >> > > You cannot have a primary key in this table. You would need another > column, for example, > > Key | Data1 | > -----|--------+ > 1 1 > 2 1 > 3 2 > 4 1 > > Then if Key is the primary key, then row two is updated UPDATE table SET > Data1=X WHERE Key=2 > > There is no ambiguity anymore. Key can be an NOT NULL AUTO_INCREMENT > column (for example) so you don't even need to specify it during INSERTs. > > >>I my opinion it would make sense to update all fields, which contain 1. >>But I am only a user, not a programmer :-) >> >> > > Well, no. What about if you want the table to look like 1, 5, 2, 1 ? The > only way possible is to use LIMIT in UPDATE or DELETE, but with no > primary key, you don't know which "row" you are updating or deleting. > > > >>>Without a primary key it is not possible to determine that a given row >>>is unique. For example, >>> >>>Data1 | >>>--------+ >>>1 >>>1 >>>2 >>>1 >>> >>> > > > - Adam > > -- Michael Zinner, GUI Developer MySQL AB, www.mysql.com Office: +43 676 753 26 30 Are you MySQL certified? www.mysql.com/certification -- MySQL GUI Tools Mailing List For list archives: http://lists.mysql.com/gui-tools To unsubscribe: http://lists.mysql.com/[email protected]