{"action":"opened","issue":{"number":61,"created_at":"2011-10-26T19:11:15Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"I can't say what all this affects, however my app is using activerecord-sqlserver-adapter and tiny_tds to connect to a SQL Server 2008 Database. I have been beating my head against the wall as when I do a simple query such as:\r\n\r\n@users = Users.limit(25).includes([:addresses])\r\n\r\nthe request takes over a minute and rails footnotes indicates there are 300 and some queries being run, most of which are:\r\n\r\nSELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' ORDER BY TABLE_NAME\r\n\r\nThis query is run over and over again hundreds of times. This confused me thoroughly as it DID NOT do this from the console, and the development.log reflected nothing of those queries. \r\n\r\nThen finally it dawned on me. I removed rails footnotes and the page now loads almost instantly without all those queries. Not sure what is up here, however it is definitely footnotes causing those to be run. In addition it also seems to only affect queries with .includes, if I remove the includes things work normally. \r\n\r\nI am using:\r\n\r\nrails-footnotes (3.7.5)\r\nactiverecord (3.1.1)\r\nactiverecord-sqlserver-adapter (3.1.1)\r\ntiny_tds (0.4.5)\r\nfreetds (0.9.1)\r\n\r\nI know not a lot of people use sql server with rails, and this is a legacy database with non-conventional column names, so I'm happy to provide whatever environment information or debugging I can do to help.","comments":0,"title":"Generating excessive queries with SQL Server Relationships","updated_at":"2011-10-26T19:11:15Z","url":"https://api.github.com/repos/josevalim/rails-footnotes/issues/61","id":2060411,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/c74a76a3bfbbc5f9ed041245c378de3b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"c74a76a3bfbbc5f9ed041245c378de3b","url":"https://api.github.com/users/chadcf","id":23989,"login":"chadcf"},"html_url":"https://github.com/josevalim/rails-footnotes/issues/61","labels":[],"state":"open"},"legacy":{"number":61,"action":"opened","issue":2060411}}