@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24



Comments:

<0> I think I could use set @begin="1.2.3.4" bitmask 255
<0> and end bitmask blah
<0> then use between and it would use index
<1> to set multiple columns in an UPDATE, do i do UPDATE table SET col1=whatever col2=whatever WHERE id=x
<1> ?
<2> daum: you need a comma seperate the sets
<1> ok, but i don't type set again do i?
<2> set col1=a, col2=b
<1> ok thanks
<0> nice!
<0> it works :)
<2> ?
<0> select count(ip) from db where ip between INET_ATON('204.17.223.128') & 0xffffff00 and INET_ATON('204.17.223.128') & 0xfffff000;
<3> !string
<3> !stringfunctions
<2> yep, do a few bits like that, they work quite well



<2> even without index, they seem quite fast
<3> i found 2-3days ago a nice page, with all mysql string manipulation function
<2> !man string
<4> (String Types) : http://dev.mysql.com/doc/mysql/en/String_types.html
<3> http://dev.mysql.com/doc/refman/5.0/en/string-functions.html
<3> thisis.
<3> what is the problem with this:
<3> SELECT nick,LENGTH(morf_lines.msg,30) FROM morf_lines WHERE morf_lines.id = 1200
<3> it said:
<3> #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 30 ) FROM morf_lines WHERE morf_lines . id = 1200 LIMIT 0, 30'
<3> but why?
<3> hmm i misspelled
<3> not length left
<5> Godsey: does an explain show that it's using an index? I highly doubt it
<6> Is there an easy way short of doing it manually, to take one DB's structure and apply it as a mask on another db that is a subset of the current one. My project is in development and I'm having a heck of a time keeping the database structure in line on different machines. Further more the production machine has live data so its not as easy as just dumping the db
<5> SJr|nx: seems like I remember mention of a db diff like program. No personal experience with it though. Another way to do this is maintain an update.sql script that you have version controlled across releases. Makes it rather easy to issue the correct alter tables, inserts, deletes, etc
<6> oh
<6> inviso_ that's good except for the fact that I'm using PHPMyAdmin :P
<5> SJr|nx: that's your second mistake
<6> lol
<6> thanks
<7> yea... nice for a quick look, or access when you only have web... but not for anything serious
<5> SJr|nx: your first mistake was telling me that ;o)
<6> no altering table structure with PHPMyAdmin?
<6> okay
<5> SJr|nx: always maintain your database structure changes in a seperate file. No particular problem with running that file through phpmyadmin, but you must maintain some kind of change control
<6> yeah
<6> I figured as much
<6> thanks.
<3> what does this mean? "Operand should contain 1 column(s)"
<3> moment i paste my query
<3> http://sql.pastebin.com/652277
<8> is there a way to have a table inside of a table? basically like an array...i need to insert more then 1 value for a column in a row. basically 8 urls, should i save them as "url1,2" and then split them manually or is there a better way?
<9> eh Therion what's a candidate key?
<10> ak_47, A row for each URL
<5> MetaMorfoziS: you can't return two columns in a subselect like that. Besides, the subselects should be derived tables rather than used as columns :(
<10> A key that is a candidate?
<11> ak_47 - either create a linkage table or 8 columns
<9> for?
<8> ah
<11> a key that *might* be used (join, query, etc)
<5> ak_47: a seperate table
<11> the optimizer must determine which keys to use
<11> based on cardinality, for example
<3> so i need an other subsselect for nick?M
<3> M-
<8> another example would be: i have tags for a image, im saving them all under "tags" seperated by comma's
<12> sjrussel: so, i think it is kjournald causing the slow down
<11> sure, IO bound is common
<8> itd be alot easier if each tag was a row, but since the user defines the tag, theres an unlimited amount
<11> ak_47 - heh
<8> if that makes sense...
<5> ak_47: yep, just make another table and link on id
<3> inviso_: so i need an other subselect for nick?
<11> !google normalization
<4> normalization: http://databases.about.com/od/specificproducts/a/normalization.htm
<7> ak_47: use a separate table and join it.
<11> ak_47, read that
<11> and then the wikipedia on the same issue
<7> ak_47: it's called a "one to many relationship"



<5> MetaMorfoziS: the way you're doing it, yes. It will perform very very poorly that way though :(
<11> and then rewrite the entire system
<3> and how can i do it better?
<8> ah
<5> MetaMorfoziS: read up on joins and use a join instead
<5> !tell MetaMorfoziS about joins
<4> Alrighty.
<3> in a subselect?
<3> use the join in the subselecet?
<13> re:
<13> I have a problem, exposed in http://pastebin.com/652293
<5> MetaMorfoziS: didn't look like you needed a subselect anyway from the quick look I took
<5> omgs: EXPLAIN your_query; Put the results up in the pastebin
<10> ARE YOU BACK FROM LUNCH inviso_?
<5> will_: long ago :) You just noticed? I'm wounded
<11> omgs, don't use varchar for keys
<11> use a linkage table
<11> and unsigned tiny/small/medium ints
<11> finally
<10> I DONT CARE
<10> LEAVE ME ALONE
<3> i'm don't udnerstand how can i solve it with joins
<10> Joins makes everything better.
<3> i need a row from other lines of this table
<3> i didn't need join it
<5> MetaMorfoziS: just a sec, I'll rewrite part of it so you can see
<13> sjrussel: that's what I'm trying to fix
<3> okay, thank you
<11> well, that's how you do it
<13> Unless I'm misunderstanding something
<14> is there anyway to write a "heap" database to the hard drive, so that it will still be there when I reboot the computer?
<10> No
<11> mysqldump
<10> ALTER TABLE
<14> aaaah ok
<11> you can specify init scripts to input the data at startup
<11> if you really need to
<14> is there a database like heap, which is fully cached to RAM? but which is also persistant?
<11> no
<5> clarks: MyISAM? ;o)
<14> inviso_: is MyISAM fully cached?
<11> and, it rarely makes sense
<5> clarks: pretty close with enough ram
<11> even if it is it's still alot slower
<5> perhaps fully so? I don't know for sure
<11> index caches and disk blocks have to be flushed to disk on write
<5> but data changes have to go to disk to be persistant which will take a hit anyway
<11> for a smal read-only table it could be fully cached
<14> ok
<14> btw, how doew one write an init script? is an "init script" automatically executed, or do you have to do it manually?
<11> iirc, automagically executed
<11> but it has to be setup
<11> it's a file of sql to run on database startup
<3> i can't.. i tried a yoin... but it's baromsag:D
<15> clarks lookup preload
<14> archivist: ok will do
<16> hi, I'm using mysql, myodbc and ado on windows, how can I get some debug information, e.g. record all sql queries sent to the server?
<17> sure
<17> !m aditsu general query log
<4> aditsu: (The General Query Log) : http://dev.mysql.com/doc/mysql/en/Query_log.html
<17> knock yourself out :)
<3> inviso_: anything?
<5> MetaMorfoziS: http://sql.pastebin.com/652313 I stripped the last subselect and rewrote it. You can use a similar technique on the remaining one. You'll need to use group by as well though
<13> sjrussel: I'm afraid I have to index a string field, because the source is the 'message_id' field, a string
<3> thanx:)
<16> Darien: thanks, checking


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #mysql
or
Go to some related logs:

aticonfig workspace
XfrmBlast
mysql is not a rdbms
This PHP environment doesn't have MySQL support built in. MySQL support is requi
#ubuntu
irrigasc.com
emerge kde-meta without kopete
Failed to set hardware overlay to head 1 immediately
pear image_transform ubuntu
buil-essential



Home  |  disclaimer  |  contact  |  submit quotes