Re: MySQL Descending ORDER issue

2013-12-27 Thread Dan Nelson
table), or credential_id (since you're using that in your WHERE clause already). -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Re: how to create unique key for long varchar?

2013-11-05 Thread Dan Nelson
primary key" error, then you can "select url from tb where md5='' ", and compare the retreived url with the one you want to insert. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Re: Animation studio asset management

2012-12-23 Thread Dan Nelson
problem putting all your shows in one table. It'll also make it a lot easier to generate queries that cover all shows if you want to generate summary reports. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Re: UDF behaves non-deterministic

2012-11-04 Thread Dan Nelson
or otherwise protected against multiple simultaneous access. http://dev.mysql.com/doc/refman/5.5/en/adding-udf.html As for debugging, you should be able to write things to stderr which will show up in the mysql logfile, or you could open your own logfile and write to that. -- Dan Nel

Re: Group expansion as part of the result

2012-03-27 Thread Dan Nelson
(status) as part of the > result? > > so: > > 20 paul 2,3,1,20,9 > 19 john 20,9 > 75 mark 1,20,9 You want GROUP_CONCAT: http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html#function_group-concat -- Dan Nelson dnel...@allantgroup.com -- MySQL General

Re: case insensitivity

2012-01-16 Thread Dan Nelson
sensitive. You can always do REPLACE(LOWER(text),from,to), though, at the expense of having your result string lowercased on you. If you need to preserve case, try the stored function at http://forge.mysql.com/tools/tool.php?id=135 . -- Dan Nelson dnel...@allantgroup.com -- MySQL G

Re: setting max_allowed_packet dynamically problem

2011-11-03 Thread Dan Nelson
ections will not change. When the server restarts, it will fall back to whatever you have set in my.cnf, or the default value if you don't have anything in my.cnf. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/m

Re: libmysqlclient from source

2011-11-03 Thread Dan Nelson
n a different machine. Try -DWITHOUT_SERVER=1 ; it's not documented, but matches the autoconf --without-server flag, which was documented. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:ht

Re: User defined Variables

2011-10-16 Thread Dan Nelson
In the last episode (Oct 16), Kailash R said: > Nice input Dan. Let me run some checks. My query is as follows: > > select group_concat(Field1), field2, field3 from table1 group by field2, > field3 into str; > @sql = concat("select blah ... where field1 in ' ,str);

Re: How to enable tabular output when reading command from file?

2011-10-16 Thread Dan Nelson
ysql commandline. In batch mode, mysql generates tab-delimited output which is easier to process. o --table, -t Display output in table format. This is the default for interactive use, but can be used to produce table output in batch mode. -- Dan Nelson

Re: User defined Variables

2011-10-15 Thread Dan Nelson
acket value. I am able to create variables containing long strings with no problems, at least: mysql> set @a=repeat('a',1024*1024*10); Query OK, 0 rows affected (0.95 sec) mysql> select length(@a); ++ | length(@a) | ++ | 10485760 | +----+ 1 row in s

Re: mysqldump: Got error: 1017: Can't find file: './ssconsole/ss_requestmaster.frm' (errno: 24) when using LOCK TABLES

2011-09-23 Thread Dan Nelson
formance though, since mysql will have to stop accessing some tables to open others. http://dev.mysql.com/doc/refman/5.5/en/not-enough-file-handles.html -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscri

Re: a lesson in query writing and (maybe) a bug report

2011-08-26 Thread Dan Nelson
at can > specify what index to use as a hint, but this particular flip was > particularly disastrous. It seems odd that the query optimizer would > choose to scan a 3.5 million entry table instead of a 20,000 entry table. Can you post the EXPLAIN EXTENDED output for your before and af

Re: Extraneous warning 1292 (Incorrect datetime value)

2011-08-07 Thread Dan Nelson
think you need to swap your arguments to DATE_FORMAT. The date comes first, then the format string. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: MySQL RAND() Issues [was Re: How to Shuffle data]

2011-07-15 Thread Dan Nelson
5(uuid()); +--+ | md5(uuid()) | +--+ | 6faefaf3f7bb9ba0d1e7a44cf6a9b1da | | 740135ab69a1825630aeaf475b39f8b8 | | 5c91a9132ad3e49e098e41d573de8e00 | +--+ -- Dan Nelson dnel...@allantgroup.com -- MySQL General Maili

Re: Optimizing column widths

2011-06-18 Thread Dan Nelson
the column definition is simply the maximum allowed size. http://dev.mysql.com/doc/refman/5.5/en/char.html -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Interesting bug/oversight

2011-05-19 Thread Dan Nelson
me other intermediate DNS client on your machine, bouncing that should work. If not, you'll need to bounce mysql. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: operation with dates

2011-05-13 Thread Dan Nelson
In the last episode (May 12), Halßsz Sßndor said: > >>>> 2011/05/12 13:06 -0500, Dan Nelson >>>> > In the last episode (May 12), Rocio Gomez Escribano said: > > I found it, > > > > mysql> select userID from user where datediff(now(), userPay

Re: operation with dates

2011-05-12 Thread Dan Nelson
ymentDate out of the function, so if you have an index on that column mysql can use it: select userID from user where userPaymentDate > (now() - interval 1 year) -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql

Re: Parse text field from query

2011-03-31 Thread Dan Nelson
+-+ | 1 | +-+ 1 row in set (0.01 sec) See http://dev.mysql.com/doc/refman/5.5/en/xml-functions.html for more info. > This is an example of the field (i need the 1 in cpu data): > > | > > > | --

Re: phantom database

2011-03-28 Thread Dan Nelson
d has both a long and short form. The long form is not case sensitive; the short form is. The long form can be followed by an optional semicolon terminator, but the short form should not. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: mysql < vs source

2011-03-10 Thread Dan Nelson
within the mysqld server rather than the mysql client, and if there is a difference between your two mysql commandlines it won't be noticed. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Group by question

2011-01-20 Thread dan
On 2011-1-16 20:22, Jørn Dahl-Stamnes wrote: Hello, I got a table that store information about which photo-albums that a client is viewing. I want to get the N last visited albums and use the query: mysql> select album_id, updated_at, created_at from album_stats order by updated_at desc limit

Re: mySQLdump has a lot of variation for time to complete

2011-01-12 Thread Dan Nelson
e system on a day that it's taking a long time to run, run some "show processlist" commands and see if there are any INSERT or UPDATEs running. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To

Re: Problem with WHERE .. IN

2010-12-20 Thread Dan Nelson
e this should work (although the 2nd query won't be able to use any indexes): SELECT parent FROM post WHERE id = 10 into @parent; SELECT id from post where FIND_IN_SET(id, @parent) > 0; If you normalize your table so that you have one row per relation: +--+-+ | id | parent | +---

Re: Query precision issue

2010-10-25 Thread Dan Nelson
| +-+-+ | -107.6898803711 | -107.6898780000 | +-+-+ 1 row in set (0.00 sec) -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Ineffective OPTIMIZE TABLES

2010-10-03 Thread Dan Nelson
pace" model, and you cannot recover unused space without dumping all your tables, deleting the ib_data* files, and restoring. MySQL 5.5.5 has finally switched the default to innodb_file_per_table=on, but if you are running any older version, you will need to set that value in your config fil

Re: INSERT DELAYED and created_on timestamps

2010-09-29 Thread Dan Nelson
ES ...) > Sep 29 03:05:02 pse05 mysqld[14640]: *** (1) WAITING FOR THIS LOCK TO BE > GRANTED: > > So I'm thinking we could use the DELAYED or LOW_PRIORITY. INSERT DELAYED only works on MyISAM, MEMORY, and ARCHIVE tables. You'll get a 1616 error if you try it on Inno

Re: Migrating my mindset from MyISAM to InnoDB

2010-09-29 Thread Dan Nelson
t; not, how can I adjust the space requirements for these tables so they >> don't take up so much additional space? Expect to see anywhere from a 1.5x to a 3x increase in size when converting from myisam to innodb, depending on your field types and indexes. It's the penalt

Re: Too Strange for Words

2010-09-18 Thread Dan Nelson
+--+---+ > 4 rows in set (0.00 sec) > > mysql> select p.weight from Passengers p; > ++ > | weight | > ++ > | NULL | > | NULL | > | NULL | > |155 | > ++ > 4 rows in set (0.00 sec) > > TIA, > Victor --

Re: Fast Index Creation and fill factor

2010-08-31 Thread Dan Nelson
to be at the beginning or the end of the block, so the block gets split in half and each new block starts out 50% full. http://dev.mysql.com/doc/refman/5.1/en/innodb-physical-structure.html -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: How many pager command within mysql command line client?

2010-08-25 Thread Dan Nelson
PAGER set to 'date' mysql> select "hello"; Wed Aug 25 15:43:46 CDT 2010 1 row in set (0.00 sec) mysql> -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Performing subtraction between fields

2010-08-21 Thread Dan Nelson
pdated, resulting in an anomalous situation You could use a trigger that updates C whenever A or B changes, to make sure it stays in synch. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://list

Re: IS NULL returns Empty set, but I have empty items

2010-07-29 Thread Dan Nelson
gt; +--+ > | | > +--+ > 1 row in set (0.00 sec) > > what goes with this, how can i ensure that this is NULL? Your url may be the empty string "". If it was really NULL, you would see "NULL" in the resultset. Try SELECT * FROM product WHERE url=&quo

Re: idle query

2010-07-27 Thread Dan Nelson
In the last episode (Jul 27), Dan Nelson said: > In the last episode (Jul 27), Mike Spreitzer said: > > If I want to try to actually hold a 2GB table in RAM, is there anything I > > need to set in my.cnf to enable that? > > Just make sure your key_buffer_size is large eno

Re: idle query

2010-07-27 Thread Dan Nelson
ry IO stats for the filesystem as a whole. > In `vmstat` output, I thought "bi" is in terms of fixed-size blocks, not > I/O commands. It looks like on Linux, "bi" and "bo" are the total disk throughput in kbytes. -- Dan Nelson dnel...@a

Re: idle query

2010-07-26 Thread Dan Nelson
d the index. You can find this number by setting key_buffer_size to a huge number (32GB for example), running "LOAD INDEX INTO CACHE" for your index, then running "show status like 'key_blocks_used'; ". http://dev.mysql.com/doc/refman/5.1/en/load-index.html --

Re: idle query

2010-07-26 Thread Dan Nelson
ad 64GB of memory? I wouldn't expect 2gb to be noticed at all :) -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: idle query

2010-07-26 Thread Dan Nelson
t; many rows as there are in the fldsnd table. I expect the result to be no > larger than the fldrcv table. So it looks like the index is making this > query run about as fast as can be expected, right? It did not take > anywhere near 9 hours to make the fldrcv table ... so why is it taki

Re: Innodb Choosing Random Index

2010-07-11 Thread Dan Nelson
m the default of 8 (try 16). That will make the estimate more accurate and hopefully mysql will pick the right index consistently. http://dev.mysql.com/doc/refman/5.1/en/innodb-parameters.html#sysvar_innodb_stats_sample_pages Another solution might be to create another index on (c1,c2), since that index is the

Re: update replace() regex

2010-07-08 Thread Dan Nelson
PDATE table SET column = replace(column, regex '%-%', ' ') where id = xxx; You don't need a regex for that. REPLACE(column, '-', ' ') should do what you want. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For

Re: selecting data for computation

2010-06-25 Thread Dan Nelson
rrently-held locks, but there isn't :( is_used_lock() will return the mysql connection ID of the session holding the lock, so what I am expecting to see is zeros, meaning that for some reason your mysql connection is getting dropped after your first query completed. Locks are held for the lifet

Re: selecting data for computation

2010-06-24 Thread Dan Nelson
irst available packet. That query shouldn't even take 2 seconds, unless you have 50k rows in the table and no index on work_data... -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Geting current user pasword.

2010-06-03 Thread Dan Nelson
e password during authentication. It's all done with hashed versions. You'll probably have to cache the original password used to make the connection, if you need to use it again later. http://dev.mysql.com/doc/refman/5.1/en/password-hashing.html -- Dan Nelson dnel...

Re: Missing database file names

2010-06-02 Thread Dan Nelson
s its tables. If they aren't in order for some reason, then you can rename the groups of files into "a.frm", "a.MYI", "a.MYD", "b.frm", "b.MYI", "b.MYD", etc, then run "show create table a" etc to determine the table layout

Re: MySQL and Syslog

2010-05-15 Thread Dan Nelson
om/doc/refman/5.1/en/mysqld-safe.html#option_mysqld_safe_syslog Next best solution: tail -F -n 0 /path/to/mysql.err | logger -p daemon.notice -t mysql Run that before starting mysql, and any lines written to the log file will get redirected to syslog. -- Dan Nelson dnel...@allantg

Re: C API Function for count(*)

2010-05-14 Thread Dan Nelson
at mysql_store_result(), mysql_num_fields(), mysql_field_count(), mysql_fetch_row(), and mysql_fetch_lengths(). There's a simple code fragment to print a resultset on this page: http://dev.mysql.com/doc/refman/5.1/en/mysql-fetch-row.html -- Dan Nelson dnel...@allantgroup.com

Re: mysql spatial functions (Was: Best index for searching on lat / long data i.e. decimal vs. float)

2010-05-03 Thread dan
It works great for me. After working out the bugs and adding the spatial index I am now searching in the 0.05 second timeframe vs. minutes otherwise. Dan On Sun, 2 May 2010 23:39:41 -0700, Rob Wultsch wrote: >>>> >> >>> On Sat, May 1, 2

Re: mysql spatial functions (Was: Best index for searching on lat / long data i.e. decimal vs. float)

2010-05-02 Thread dan
x27;))')); (I also created a new GEOMETRY lsd_poly column rather than the poly POLYGON one). Now I need to figure out the rest of it... Dan On Sun, 2 May 2010 14:00:16 -0700, Ted Yu wrote: > Have you declared poly to be of spatial type ? > Cheers > > On Sun, May 2,

Re: mysql spatial functions (Was: Best index for searching on lat / long data i.e. decimal vs. float)

2010-05-02 Thread dan
NOT NULL On Sun, 2 May 2010 14:00:16 -0700, Ted Yu wrote: > Have you declared poly to be of spatial type ? > Cheers > > On Sun, May 2, 2010 at 1:03 PM, dan wrote: > >> >> Tried it but no luck: >> >> mysql> UPDATE `grid` SET poly = GeomFro

Re: mysql spatial functions (Was: Best index for searching on lat / long data i.e. decimal vs. float)

2010-05-02 Thread dan
Sun, 2 May 2010 12:54:07 -0700, Ted Yu wrote: > Have you tried replacing GeomFromText in place of PolygonFromText ? > > On Sun, May 2, 2010 at 10:59 AM, dan wrote: > >> >> I am still lost... I tried this: >> >> UPDATE `grid` SET poly = PolygonFromTex

Re: mysql spatial functions (Was: Best index for searching on lat / long data i.e. decimal vs. float)

2010-05-02 Thread dan
4145, 49.07756615 101.36764145, 49.07756615 101.36211395) | | POLYGON(49.08123016 101.36211395, 49.07756615 101.36211395, 49.07756615 101.36764145, 49.08123016 101.36764145, 49.08123016 101.36211395) | | POLYGON(49.08489418 101.36211395, 49.08123016 101.36211395, 49.08123016 101.36764145, 49.0848

Re: mysql spatial functions (Was: Best index for searching on lat / long data i.e. decimal vs. float)

2010-05-02 Thread dan
mal lat / long data. Dan On Sun, 2 May 2010 06:43:13 -0700, Ted Yu wrote: > I think you may have seen this: > http://dev.mysql.com/doc/refman/5.0/en/relations-on-geometry-mbr.html > > On Sat, May 1, 2010 at 11:12 PM, dan wrote: > >> >> Can any one hel

mysql spatial functions (Was: Best index for searching on lat / long data i.e. decimal vs. float)

2010-05-01 Thread dan
nds a specific point. Dan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Best index for searching on lat / long data i.e. decimal vs. float

2010-05-01 Thread dan
On Sat, 01 May 2010 15:28:46 -0500, mos wrote: > > SELECT * FROM `grid`� force index(section) WHERE n > 49.012 AND s < 49.012 > AND e > > 110.0244 AND w < 110.0244; > > It should give you the answer around 0.1 seconds. Give it a try. :-) > > Mike It actually makes it worse by ab

Re: Best index for searching on lat / long data i.e. decimal vs. float

2010-04-30 Thread dan
> 49.012 AND s < 49.012 AND e > 110.0245 AND w < 110.0245; but takes an average of 15 seconds Dan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Best index for searching on lat / long data i.e. decimal vs. float

2010-04-30 Thread dan
long) to find the specific area that the point is located in. I tried a simple index with my n,e,s & w but it still takes along time to run such a query i.e. phpmyadmin times out. Any idea on the best structure for such a query? Thanks, Dan T -- MySQL General Mailing List Fo

Re: How to select rows from only the first N rows in a table?

2010-04-27 Thread Dan Nelson
ed' ORDER BY DATE LIMIT 10 which will return the 10 oldest red products, even if they are the 10 newest records in the table. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: CLI can't read data from table

2010-04-14 Thread Dan Nelson
changed > > test> CREATE TABLE `lines` (id int unsigned NOT NULL PRIMARY KEY) > > ENGINE=InnoDB; Query OK, 0 rows affected (0.20 sec) > > Yup, that was it. I'm migrating from Postgres, so it never occured to me > that "lines" might be reserved. On the

Re: Make delete requests without impact on a database

2010-04-14 Thread Dan Nelson
OW_PRIORITY keyword to your DELETE statement; that will keep the DELETE from moving to the front of the queue if there are other SELECT statements pending. http://dev.mysql.com/doc/refman/5.1/en/delete.html -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For l

Re: Recommended swap partition size

2010-04-13 Thread Dan Nelson
48 GB of memory and they all live just fine without swap. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: MyISAM better than innodb for large files?

2010-04-02 Thread Dan Nelson
better than myisam > tables for most OLTP users, and as your number of concurrent readers and > writers grows, the improvement in performance from using innodb over > myisam becomes more pronounced. His scenario is "perhaps updated once a year", though, so crash recovery and m

Re: Is Mysql for freebsd 8.0 available?

2010-03-17 Thread Dan Nelson
xist? MySQL doesn't provide binaries, but the FreeBSD ports tree lets you build it yourself, and has ports for MySQL 3.23, 4.0, 4.1, 5.0, 5.1, and 5.5. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To uns

Re: mysql & RAID

2010-03-10 Thread Dan Nelson
your app does). RAID-10 is just a mirror so it doesn't have to worry about that. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: 5.1.44 community version select ordno>=' ' error (2)

2010-03-03 Thread Dan Nelson
gt;' ' > ordno qty > 1 > 3 > 5 > 'aaa' 18 > 'b' 20 > > select * from t1 where ordno>=' ' > ordno qty > 'aaa' 18 > 'b' 20 > > mysql version 5.

Re: 5.1.42 community version select ordno>=' ' error (2)

2010-03-01 Thread Dan Nelson
=' '; +---+ | ordno | +---+ | | | | | | | 000 | | abc | +---+ 5 rows in set (0.00 sec) mysql> select * from table1 where ordno>' ' or ordno=' '; +---+ | ordno | +---+ | | | | | | | 000 | | abc | +-

Re: EXPLAIN says DEPENDENT SUBQUERY despite no free variables

2010-02-24 Thread Dan Nelson
ions almost always treat subqueries as dependent, even ones that are obviously not. The 6.0 branch was a significant improvement, but that branch has been killed off, and there's no indication of the fixes being backported to 5.x . -- Dan Nelson dnel...@allantgroup.com

Re: Event feature already working in Server 5.1.37

2010-01-27 Thread Dan Nelson
, MySQL, ASP > WAMP - Win, Apache, MySQL, PHP > WWSHM - Win, Windows Scripting Host, MySQL > WTM - Win, Tomcat, MySQL > ... > > Are there other stacks on MS that you have heard of or are using? WWJD - Windows, Websphere, Java, Derby? :) -- Dan Nelson dnel..

Re: Event feature already working in Server 5.1.37

2010-01-25 Thread Dan Nelson
shes, and other operations completely within MySQL. The events will also fire the same whether the server is running Unix or Windows. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Subquery performance slow to non-existent...

2010-01-19 Thread Dan Nelson
;NGV21","NGV22","NGX09","NGX10","NGX11","NGX12","NGX13","NGX14","NGX15","NGX16","NGX17","NGX18","NGX19","NGX20","NGX21","NGX22","NGZ09","NGZ10", > "NGZ11","NGZ12","NGZ13","NGZ14","NGZ15","NGZ16","NGZ17","NGZ18","NGZ19","NGZ20","NGZ21","NGZ22"); > > Running query b gives me a result set as follows: > > | 2010-01-15 | NYMEX | NGZ22 | 8.9620 | 8.9680 | 8.9620 | 8.9680 > | 0 | > ++++-+-+-+-++ > 86765 rows in set (4.46 sec) > > I then because I want to generalize query b I continue by creating query c > as follows: > mysql> select * from endOfDayData where endOfDayData.market like 'NYMEX' > and endOfDayData.symbol IN (select names.symbol from names where > names.market like 'NYMEX' and names.name like 'natural gas {%'); > > Query c seems to have good syntax as neither the command line mysql > interface nor the gui spit it back but it literally takes forever to run; > I've waited at least twenty minutes and not got anything back. I'm running > Ubuntu 9.10 on an intel core i7 with 4GB RAM and 12GB swap... the process > monitor doesn't even flinch so I'm not thinking hardware here... why is the > sub-query running so slow? MySQL's subquery optimizer is pretty bad. I bet if you explain that query, mysql thinks the subquery is dependant. That means that it will run the subquery for each row of the outer query, even though it's obviously not going to change from row to row. Your best bet for now is to do what you're currently doing with queries A and B. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: query returning empty row

2010-01-17 Thread Dan Nelson
haps his hospital ID is not 1234, or cMmrcashworker is not 2, or cCurstatus = 'complete'. Try SELECT updateDate,cCurstatus,cMmrcashworker,cHospital,cHospital1,cHospital2 FROM med_patient WHERE updateDate between '2010-01-01' and '2010-01-28' order by i

Re: Better that `NOT IN`

2010-01-15 Thread Dan Nelson
27;outter' query using PHP's implode() or > something. I suspect this would be significantly faster no? IN() using constants should be very efficient. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Can't open file error number 24

2010-01-10 Thread Dan Nelson
tml http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_open_files_limit http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_table_open_cache http://dev.mysql.com/doc/refman/5.1/en/table-cache.html http://bugs.mysql.com/bug.php?id=17646 http

RE: table export in cron

2010-01-07 Thread Dan
users entered a blank space > which is then counted as a character and is thus not null. > > This is causing all kinds of havoc for them as Oracle apparently still > sees this as nulls. I'm not sure what export method you're using, but you should be able to fix t

Re: Consult with group

2009-11-28 Thread Dan Nelson
ur case you would want to group by the first three columns only). http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html#function_group-concat -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Table size vs Memory requirements?

2009-11-22 Thread Dan Nelson
to cache the entire index, but not the data, so you need to do one disk seek per lookup). Next best would be enough to cache all but the leaves of the index (requiring one index and one table seek per lookup); this depends on your key size but 200MB should be enough. -- Dan Nelson

Re: MySQL - determine last date of shutdown and analyze

2009-10-26 Thread Dan Nelson
n the mysqld error logfile (in your data directory, it's the only file ending in .err). I don't think any of the storage engines keep track of when the last analyze was done, though. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives:

Re: Low performance due high network latency - batching ?

2009-10-20 Thread Dan Nelson
me (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9); -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Error - "Select Column Not Found Within Trigger"

2009-10-17 Thread Dan Saul
27;, > > `description` text collate utf8_bin NOT NULL, > > PRIMARY KEY (`line_number`) > > ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ; > > > - michael dykman > > > On Sat, Oct 17, 2009 at 2:20 PM, Dan Saul wrote: > >

Error - "Select Column Not Found Within Trigger"

2009-10-17 Thread Dan Saul
n` text collate utf8_bin NOT NULL, `daily_charge` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=4 ; Thank you in advance. Dan

Re: Dump / restore rows in table?

2009-10-07 Thread Dan Nelson
mysqldump --no-create-info --compact --where 'rowid between 100 and 1050' mydb oldtable Note that the inserts include the table name, so if you're loading into a different table, you'll need to rewrite the output with sed, or maybe create a "select * from oldtable" v

Re: many-inserts go faster the second time

2009-09-25 Thread Dan Nelson
e, and the first batch of inserts pulls most of the index and some of the table data into RAM, which makes for much faster lookups on the next run. What do top and iostat stats show on both runs? I'd expect heavy disk usage and little CPU on the first run, and light disk and heav

Re: Access denied; you need the RELOAD privilege for this operation

2009-09-20 Thread Dan Nelson
awback here, if it's more at the operational level of old Berkely DB 1.x-style databases (where one has to manually maintain the index, there are no transactions, etc). SQL-based databases sit on top of the lower-level table engines and handle all that work for you. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Right Date format mask

2009-09-14 Thread Dan Nelson
e. Assuming your input string is in mm/dd/yyy format, you would want a format string of "%m/%e/%Y %r". -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: InnoDB doubles size when converting from MyIsam

2009-09-12 Thread Dan Nelson
ure.html http://dev.mysql.com/doc/refman/5.1/en/innodb-physical-record.html -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Very Slow Query

2009-08-28 Thread Dan Nelson
nd matching rows. In general, you want an index on any fields used in a WHERE clause. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Very Slow Query

2009-08-28 Thread Dan Nelson
you run just the "select ..." part, is it slow also? Do you have an index on pat1.assignee? What does an EXPLAIN on the select print? -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Inquiry:MySql table data missing problem

2009-08-19 Thread Dan Nelson
no: 145)" $ perror 145 MySQL error code 145: Table was marked as crashed and should be repaired $ You need to repair your table: http://dev.mysql.com/doc/refman/5.1/en/repair.html -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archive

Re: show tables is slow/uncached

2009-08-16 Thread Dan Nelson
le containing all tables in all databases, then filter it on your WHERE clause. In your case, caching the results in your own table might be the best solution. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Erratic query performance

2009-08-13 Thread Dan Nelson
= "D") > Primary key: id (int) > Indexed on: Comm_id (varchar(6)) > > create temporary table tmp type = heap > select distinct 3 filterid, m.id, "" GroupLevel, 0 GroupCum > from main m > left join receipt r on m.id = r.mainid > left join campaccommon.co

Re: Slow performance Query

2009-08-11 Thread Dan Nelson
+-+-+---+--+---+ > | 1 | SIMPLE | app_user | ref | user_id | user_id | 8 | > const |5 | | > ++-+--+--+---+-+-+---+--+---+ > 1 row in set (0.01 sec) --

Re: When does indexing happen?

2009-07-26 Thread Dan Nelson
eking for the same row will > find it using the index? Yes. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Slow query Performance

2009-07-16 Thread Dan Nelson
l only has to jump to the 495536 quiz_id section, and all the user_ids are all right there. That should cut your query time by 50% (since you still have to do 68 seeks to the table rows to fetch result_id). If you also add result_id to your compound index, then mysql will be able to get all its inf

Re: Another Trigger Question!

2009-07-08 Thread Dan Nelson
like to insert a record > into a entirely separate table in a separate DB. insert into smsgw.outbox [...] -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Triggers For Radius DB

2009-07-07 Thread Dan Nelson
its values by SETting NEW.fieldname: IF NEW.NASPortID = 21 THEN SET NEW.AcctInputOctets=(0 - NEW.AcctInputOctets); SET NEW.AcctOutputOctets=(0 - NEW.AcctOutputOctets): END IF; -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: How to use LIKE for detecting numbers with commas?

2009-07-06 Thread Dan Nelson
M table where numbers LIKE '8,%' or numbers LIKE '%,8,%' or > numbers LIKE '%,8' Even better: SELECT * FROM table WHERE find_in_set('8',numbers); http://dev.mysql.com/doc/refman/5.1/en/string-functions.html#function_find-in-set -- Dan Nelso

Re: What OS is the best platform for MySQL ?

2009-07-06 Thread Dan Nelson
se the MySQL thread does not end although complied with > LINUX_THREADS. Try building without LINUX_THREADS; that option shouldn't really be used with FreeBSD 6 or newer. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://list

Re: Custom agregate functions

2009-06-30 Thread Dan Nelson
In the last episode (Jun 30), Dainis Polis said: > Hi MySQL fans! > > Is there way to create subj ? http://dev.mysql.com/doc/refman/5.1/en/adding-functions.html http://dev.mysql.com/doc/refman/5.1/en/adding-udf.html http://dev.mysql.com/doc/refman/5.1/en/udf-aggr-calling.html --

Re: Half Hour Sub-query in MySQL vs. 5 Seconds in VFP?

2009-06-19 Thread Dan Nelson
--+---+---+-++--+---+ Note that the queries have flipped and aren't nested anymore (id is 1 on both queries). The first query uses the ename index and estimates it will return one row. The second query uses the mgr i

Re: How to Optimize distinct with index

2009-06-18 Thread Dan Nelson
n user_id, but after in, order use temporary table, > How to optimize it? Mysql should have been able to use the index here, I think. Please post the output of "create table user", a sample query, and its EXPLAIN output. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

  1   2   3   4   5   6   7   8   9   10   >