[MonetDB-users] Best way to lookup a varchar field?
Hi, I've got a very simple table structure in SQL, with a non-unique varchar field and a few other fields including a CLOB. I found that it's abnormally slow to filter the varchar field with an 'IN' statement and simply return the CLOB. i.e.: select clob from x where varchar in ('a','b','c') With a couple million rows, the query is in multiple seconds if the results are around a couple thousand rows. Is there something I'm doing wrong? I should be just the varchar BAT filter, then join on the CLOB BAT. Should I manually assign the varchars to integers in another table and use ints on this table? That would be surprising... Thanks. H
Henri, prefix your query with TRACE, i.e., TRACE select clob from x where varchar in ('a','b','c'); to produce a detailed performance trace that tells you and us where time goes in your case. Stefan On Fri, May 08, 2009 at 11:12:37AM +0300, Henri Asseily wrote:
Hi, I've got a very simple table structure in SQL, with a non-unique varchar field and a few other fields including a CLOB. I found that it's abnormally slow to filter the varchar field with an 'IN' statement and simply return the CLOB. i.e.: select clob from x where varchar in ('a','b','c')
With a couple million rows, the query is in multiple seconds if the results are around a couple thousand rows. Is there something I'm doing wrong? I should be just the varchar BAT filter, then join on the CLOB BAT. Should I manually assign the varchars to integers in another table and use ints on this table? That would be surprising...
Thanks. H
------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4312 |
participants (2)
-
Henri Asseily
-
Stefan Manegold