Home Page   #c  #ruby-lang  #cisco  #mysql  #apache  #javascript  #java  #perl  #php  #openmoko   Wallpapers Girl
Reliable $1 Web Hosting by 3iX

Channels


#mysql

03 October 2007


Total 31 pages. You are browsing page 2/31.

First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last

00:50 <****> why do you guys care about the old code?
00:50 <****> I'm trying to make a new one.. :)
00:50 <****> Cypherus: Remember GROUP BY.
00:51 <****> back to where we started in this conversation.. : )
00:51 <****> I've never used GROUP BY
00:52 <****> So could you please provide me with some examples similar to my case, that are readable for a person who's not an MySQL expert?
00:52 <****> Cypherus: How many news do you have?
00:53 <****> around 500, but there a limit to 20 per page.
00:55 <****> Cypherus: You may not want to use GROUP BY.
00:55 <****> Cypherus: Just do your 21 queries.
00:55 <****> I think he wants GROUP BY
00:56 <****> so it would require let from the server to run 21 queries?
00:56 <****> Cypherus: What is the "first" query, and what are each of the child queries?
00:57 <****> seekwill: He will get a query that sorts all comments.
00:57 <****> First query: SELECT ID_entry, entry, unix_timestamp( now() ) - unix_timestamp(sb_entries.date) as date, name, username FROM sb_entries,sb_users WHERE author='$rows[ID]' AND author=ID ORDER BY date DESC LIMIT 20
00:57 <****> 20 last: SELECT NULL FROM sb_responds WHERE post='$_GET[post]'
00:58 <****> What is POST?
00:58 <****> $_GET[post]
00:58 <****> ops, wrong one..
00:59 <****> post='$rows[id]'
00:59 <****> Name which table each column comes from as well
01:00 <****> ill give you the entire DB
01:00 <****> No
01:00 <****> Just tack in the table name in front of each column, like you should
01:00 <****> ...anyways.
01:01 <****> Cypherus: Do you have any performance problems?
01:01 <****> http://pastebin.com/m495f2467
01:01 <****> ElDiabolo, No.. But I just want it to run on less queries..
01:02 <****> because I've heard that more queries takes up more memory
01:02 <****> Cypherus: Why is this an improvement?
01:02 <****> and were soon integrating this site into facebook (and some other SCs), so were expecting alot more queries..
01:02 <****> ElDiabolo, I don't know. I've just heard it..
01:02 <****> Would it be better to run 21 small queries than one big one?
01:03 <****> Sometimes.
01:03 <****> Cypherus: Depends on the costs of the individual queries.
01:04 <****> Cypherus: Still waiting for your new query
01:04 <****> ok then.. ill just stick to 21 queries
01:04 <****> seekwill, new query?
01:04 <****> Cypherus: By now you have a very small database and there is no need to worry. You my want to do performance testing with sth. like apache bench.
01:04 <****> Yeah. Well, if you're going to give up.... not needed anymore
01:05 <****> so it's not about how many queries I run, it's about how big the database is?
01:05 <****> It depends on a lot.
01:05 <****> seekwill: He is probably better of with 21 queries than with a GROUP BY LIMIT 20.
01:05 <****> ElDiabolo: Eh, maybe, maybe not.
01:06 <****> ok.. I guess it's better to leave to part out for later..
01:06 <****> and continue with the working
01:06 <****> Hello. At the pastebin: http://pastebin.ca/723662 I cannot figure out how to use variables for the database and table after the FROM in each case, is there a way to do this in mysql?
01:08 <****> its considering a "table" when I call it, and I do not think it would be wise to just use in_table
01:08 <****> seekwill: IMHO he should not do a questionable change without any performance problems.
01:08 <****> ElDiabolo: I agree!
01:08 <****> ElDiabolo: That's why I dropped it
01:08 <****> But it never hurts to try ;)
01:11 <****> What's wrong with this query?
01:11 <****> SELECT * FROM campaigns JOIN targeting_keywords ON campaign.id targeting_keywords.campaign_id WHERE active = 0
01:12 <****> campaign.id
01:12 <****> campaigns
01:12 <****> Ah... did not see that. Thank you chadmaynard :)
01:12 <****> StevenBao: =
01:12 <****> MySQL tells you what's wrong...
01:13 <****> #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 'targeting_keywords . campaign_id WHERE active = 0 at line 1
01:13 <****> say I want to store results from a complex query in a table, and then query from this table quite frequently, and then drop the table and rebuild it at each cron, how do I insure that my frequent queries from users wont end up in error while the table is not there?
01:13 <****> Looks like the = wins!
01:13 <****> seekwill: Actually it tells you to often that there is an error in your SQL syntax.
01:13 <****> ElDiabolo: And exactly where to look!
01:13 <****> ElDiabolo: do you have to argue everything?
01:13 <****> Wait... then what is the problem?
01:13 <****> StevenBao: the = and then the spelling
01:14 <****> campaigns.id = targeting_keywords...
01:14 <****> chadmaynard: No. Do you mind?
01:14 <****> Ohh...
01:14 <****> ElDiabolo: yes
01:14 <****> ElDiabolo: You shouldn't have asked.
01:14 <****> hehe
01:18 <****> Need to go to bed anyway. n8.
01:26 <****> I have a mysql table structure question:
01:26 <****> good
01:27 <****> Is it possible to make an index "id" which is increased by 1.
01:27 <****> But
01:27 <****> but
01:27 <****> It starts at 1000, and some rows may be deleted, therefore when adding a new row, I would like it to be able to end to the last id, or an unused id.
01:28 <****> add*
01:28 <****> Is there a way to do with without querying the entire table?
01:29 <****> EXPLOSION!
01:29 <****> Actually no, false alarm
01:30 <****> what happen to reads on a table during a RENAME TABLE like old_table to tmp_table, new_table TO old_table ?
01:30 <****> Trent: use autoincrement, it won't fill in the blanks but what's the point?
01:31 <****> chadmaynard, It doesn't have to fill in blanks, however. How do I start at 1000 with autoincrement?
01:31 <****> !man alter ta
01:31 <****> see http://dev.mysql.com/doc/refman/5.0/en/alter-table.html
01:32 <****> Trent: read that link (or search for increment on that page)
01:32 <****> there is a code example
01:37 <****> what happen to reads on a table during a RENAME TABLE like old_table to tmp_table, new_table TO old_table ? would they wait like for a LOCK, or would they produce errors?
01:39 <****> If I have an item which can have only two states, should I use a BOOLEAN or ENUM type for the column in question?
01:39 <****> BOOLEAN is_green or ENUM color...
01:43 <****> is there a way in an sql query to do something like "if x<1000; x=x/3;" for every row in a table?
01:44 <****> Hello?
01:46 <****> gfhghgfhfg: maybe neither, but ENUM is generally not as portable as an int
01:47 <****> Entelin: SELECT if(x<1000,x/3,x) x ....
01:51 <****> chadmaynard: Portable?
01:51 <****> To other database software?


Total 31 pages. You are browsing page 2/31.

First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last


Tutti i nuovi CAP Italiani. Come ottenere il database completo