You should still lose the pointless WHERE 1.
Arthur
On Sun, Dec 4, 2011 at 1:38 AM, Jan Steinman j...@bytesmiths.com wrote:
DOH! Brain unfroze, and I realized I needed an aggregate:
SELECT
COUNT(lib.Dewey) AS Have,
ddn.Dewey AS DDN,
ddn.Classification AS Classification
FROM
Hi Reindl,
Thanks for your quick answer, but i think the engine is MySAM but I'm not
sure, What type of index recomendais me, unique, full-text, etc..?
Thanks a lot
2011/12/4 Reindl Harald h.rei...@thelounge.net
Am 04.12.2011 20:25, schrieb Rafael Valenzuela:
Hi all,
In one query, I am
you THINK the engine is? WTF?
fulltext if you need fulltext-search
please read the manuals i linked!
Am 04.12.2011 21:20, schrieb Rafael Valenzuela:
Hi Reindl,
Thanks for your quick answer, but i think the engine is MySAM but I'm not
sure, What type of index recomendais me, unique,
Rafael,
Without more details it is hard how you can optimize a query.
1. even though database 1TB, what about the table on which your running
this query? Do you have any index on the column? How may chars long is the
column? etc.
2. Run the explain and see what is the optimizer is telling -
Well, of that which you showed you _need_ only this, not really different from
that which you wrote:
SELECT
COUNT(lib.Dewey) AS Have,
ddn.Dewey AS DDN,
ddn.Classification
FROM s_library_dewey ddn
LEFT OUTER JOIN s_library lib ON ddn.Dewey = FLOOR(lib.Dewey)
GROUP BY ddn.Dewey
As for