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

Channels


#mysql

17 October 2007


Total 30 pages. You are browsing page 3/30.

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

01:50 <****> rgr, not sure why you said that
01:51 <****> looking for clues how to design a schema for scheduling
01:51 <****> I was just referring to your first "pro" - all good advice. Thanks. I like the idea of not joining though for simple things like "who updated this record last" - you get the UID directly for display purposes.
01:53 <****> what's faster, 4 queries, or 1 join?
01:54 <****> it depends on the queries and the join.
01:55 <****> hey, i'm HAVING some problems with my HAVING clause ha! http://rafb.net/p/uTPajF51.html <-- in that structure, id_menu is the 'parent menu' id, so i'm trying to return a query with all top level menu names with the corresponding first sub menu, where "first" is determined by the child menu's sort id (ie. the lowest sort_id is the first menu item). it appears to be ignoring the HAVING clause altogether and i can't quite figure out why... any idas?
01:55 <****> s/idas/ideas/
01:57 <****> how can i copy a table to the same database just with a different name?
01:57 <****> export the definition of the stable (sql), change the table name in the script, and execute the script
01:58 <****> wanderingii: CREATE TABLE ... LIKE ...; INSERT INTO ... SELECT ...;
01:58 <****> s/stable/table/
01:58 <****> just when i thought i had HAVING figured out too ... this is a real doozy. i can't figure it out for the life of me!
02:00 <****> dools: Your HAVING criterial isn't helpful here. It's like saying HAVING (true)
02:02 <****> Xgc: oh right... is there a way i can stipulate that i want to select the child item with the lowest sort id for that group?
02:02 <****> dools: Yes. http://dev.mysql.com/doc/refman/5.0/en/example-maximum-column-group-row.html
02:03 <****> Xgc, actually that having restricts to groups where not all child_item.sort_id IS NULL
02:03 <****> gnari: Correct.
02:03 <****> gnari: Effectively true in this case.
02:03 <****> ha! i see now
02:03 <****> Xgc, but that was surely not what was wanted
02:03 <****> gnari: correct again!
02:04 <****> Xgc: great link thankyou
02:04 <****> dools: You're welcome.
02:10 <****> Will a select limit 1 query against a big table (3000 rows) take longer to execute than the same query against a table with 5 rows? What I'm wondering is; should I move old data over to another table so that working with newer data goes more smoothly or is the load time only dependent on the rows select, not the total number of rows?
02:16 <****> I think its a great question
02:17 <****> ramvi it depends
02:17 <****> select * from t limit 1; will be just as fast on a table with 5 rows as with 5 million
02:18 <****> select * from t group by t order by u limit 1; will be much slower on 5 milion rows
02:18 <****> A little light just came on somewhere
02:19 <****> So I should try avoid using group by..?
02:21 <****> order by makes a difference too
02:21 <****> the lesson isn't not to use group by
02:21 <****> the lesson is that different queries take different times in different situations and that your question includes a shitty example that doesn't really tell us anything
02:22 <****> ask again but replace "select limit 1" with a real query
02:22 <****> hehe
02:22 <****> SELECT eoi, eoistatus, due, nextStatus, shouldDue FROM `redflag` WHERE nextStatus != "SETTLED" AND nextStatus != "FALLOVER" AND due < NOW()
02:24 <****> Better?
02:25 <****> the easy answer is yes
02:25 <****> but 3000 rows is not a big table
02:26 <****> the != is not very index friendly
02:26 <****> But nextstatus isnt the index..?
02:27 <****> due is the index?
02:28 <****> No, eoi is the primary / index. I
02:29 <****> Is my query dirty, ugly and bad?
02:29 <****> ramvi, can you rewrite it as nextStatus IN ( list of possible items that are not SETTLED or FALLOVER )?
02:29 <****> the query is fine if that is your requirement, it will search every row to find the result
02:30 <****> Simetrical, no :/ It can be any string
02:30 <****> ramvi, it's not really ideal. Requires scanning all rows with due<NOW(), at least, I think. Can indexes be used at all for !=?
02:31 <****> kimseong, so if all rows with nextstatus were in their own table, the query would be executed faster?
02:32 <****> ramvi: in their own table? you just said it can be any string, how many table you want to have, and searching all those tables will not guarantee it will be faster
02:33 <****> at least index due, or (due,nextStatus) for this particular query
02:33 <****> kimseong, it can be any string. But I know that the once with settled and fallover isnt needed far as often as rows where the nextstatus is something else
02:34 <****> Generally speaking, it probably would not be best to split these into another table.
02:34 <****> Thanks :)
02:38 <****> bye ramvi !
02:39 <****> You want me to leave?
02:39 <****> no
02:39 <****> i thought you were though
02:39 <****> hehe =)
02:41 <****> hello all
02:41 <****> Hi there
02:41 <****> how could i do a regex to only match if my pattern appears before a certain character?
02:41 <****> i have a column that holds email addreses
02:43 <****> smellis, if you need to do that search, you should split the address across two columns.
02:43 <****> smellis, however, you can do 'myregex.*@'.
02:44 <****> unfortunately i dont have that option
02:44 <****> the software that uses the table wants the columns that way
02:44 <****> horrible i know
02:44 <****> i have to work around it
02:44 <****> lol
02:44 <****> Hi!
02:44 <****> smellis: what is your pattern?
02:44 <****> How can I extact the last element from a DB.
02:45 <****> define last element
02:45 <****> corrideat, SELECT * FROM table ORDER BY id DESC LIMIT 1; will probably do what you want, where "id" is the primary key.
02:45 <****> I tried SELECT ... BY id DESC LIMIT 1 but doesn't work.
02:46 <****> kimseong, what is the last-enetered item.
02:46 <****> looking for a graphical schema designer for Linux
02:46 <****> kimseong: i want a pattern of "mpt" to not match for "user@mptelco.com"
02:46 <****> Simetrical, I get the first one.
02:47 <****> corrideat: there is no order for the rows in the table, the db does not know the last row you insert, you have to rely on some values in the column, depending to how you insert and what you store in the columns
02:47 <****> corrideat, if you're getting the last value inserted, you're giving your numbers id's backwards.
02:47 <****> http://cheatnation.org
02:47 <****> Er, the first, rather.
02:47 <****> http://cheatnation.org
02:47 <****> http://cheatnation.org
02:48 <****> kewl
02:48 <****> http://cheatnation.org
02:48 * Simetrical suspects this is not an SQL question
02:48 <****> i think i know what i need to do
02:48 <****> smellis: if you mean have mpt in username part, then mpt.*@ to make sure that it appear before the @
02:48 <****> http://cheatnation.org
02:48 <****> http://cheatnation.org
02:48 <****> smellis, WHERE email REGEX 'mpt.*@'.
02:48 <****> Simetrical, kimseong, I have an id element which has the auto_increment value. I'm seeing in phpMyAdmin the element I need which has the higher id.
02:49 <****> corrideat, what does this return? SELECT id FROM table ORDER BY id DESC LIMIT 1; ?
02:49 <****> http://cheatnation.org
02:49 <****> http://cheatnation.org
02:49 <****> http://cheatnation.org
02:49 <****> http://cheatnation.org


Total 30 pages. You are browsing page 3/30.

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


Tutti i nuovi CAP Italiani. Come ottenere il database completo