[{"data":1,"prerenderedAt":258},["ShallowReactive",2],{"project-15016949":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":27,"sentiment":28,"stance_mix":29,"scored_comments":34,"aspects":35,"strip":41,"post_text":42,"what":43,"said":74,"maker_in_thread":148,"shape":153,"grid":157,"attempts":221,"same_week":222,"maker_shows":39,"maker_hidden":251,"reader_version":252,"card":253},"15016949","SQLCheck","Automatically identify anti-patterns in SQL queries","title","Show HN: SQLCheck – Automatically identify anti-patterns in SQL queries","https:\u002F\u002Fgithub.com\u002Fjarulraj\u002Fsqlcheck","github.com","jarulraj",1502793244,2017,61,26,696,2242,32,"notable","dev_tools","sql linter","cli",[24,21,25,26],"sql anti-patterns","query optimization","sql best practices","roasted",-0.44,{"positive":30,"neutral":31,"mixed":32,"critical":33},0,6,1,7,14,{"docs":36,"idea":38,"execution":40},{"positive":30,"critical":37},3,{"positive":30,"critical":39},4,{"positive":30,"critical":30},[32,37,37,30,32,30,32,37,30,37,30,37,30,30,32,30,32,32,32,37,30,30,30,30,37,30],null,{"problem":44,"audience":54,"pricing":42,"motivation":59,"time_to_build":42,"stack":63,"openness":72,"stage":73,"team_size":73},{"value":45,"source":46,"evidence":47},"Finds anti-patterns in SQL queries that may hurt performance or readability.","maker",[48,51],{"id":49,"by":11,"text":50},"15020100","I agree that executing fewer SQL queries is often better for performance. However, it is possible that an elaborate SQL query that has to use many joins, correlated subqueries,…",{"id":52,"by":11,"text":53},"15020762","Sure :) Any other interesting suggestions? I must mention that I greatly admire your pragmatic books on improving database performance, and they were a source of inspiration for…",{"value":55,"source":56,"evidence":57},"Developers writing SQL queries.","inferred",[58],{"id":49,"by":11,"text":50},{"value":60,"source":46,"evidence":61},"Help developers simplify and modularize complex SQL queries.",[62],{"id":49,"by":11,"text":50},[64],{"value":65,"source":66,"evidence":67},"C++","commenter",[68],{"id":69,"by":70,"text":71},"15019141","bsg75","The tests in this read like someone who has only used one SQL dialect, and wanted another project to show off C++ abilities. Its full of bad advice that does little to help…","open_source","unknown",{"praise":75,"objections":86,"requests":118,"questions":139,"alternatives":147},[76],{"value":77,"source":66,"evidence":78},"Interesting idea and useful as a hint tool.",[79,83],{"id":80,"by":81,"text":82},"15019445","extrapickles","The join one is particularly bad as it can make your query run much slower as running multiple queries is almost never a win. A check for the opposite (multiple queries when one…",{"id":84,"by":11,"text":85},"15020151","Thanks for sharing these interesting anecdotes.",[87,96,107],{"value":88,"source":66,"evidence":89},"Some checks, like splitting queries and avoiding JOINs, may give bad advice.",[90,91,92],{"id":69,"by":70,"text":71},{"id":80,"by":81,"text":82},{"id":93,"by":94,"text":95},"15019810","kuschku","Yup, the \"CheckSpaghettiQuery\" is a recipe for disaster. I have a query here that runs on a raspberry pi running postgresql with 7 GB of data (chat logs in a postgres table, with…",{"value":97,"source":66,"evidence":98},"Column prefixing and generic id naming are disputed.",[99,103],{"id":100,"by":101,"text":102},"15019481","Achshar","https:\u002F\u002Fgithub.com\u002Fjarulraj\u002Fsqlcheck\u002Fblob\u002Fmaster\u002Fdocs\u002Flogical\u002F1004.md Strongly disagree. Table columns should always be prefixed with table name. So users.user_id is one of the…",{"id":104,"by":105,"text":106},"15020391","CWuestefeld","This doesn't allow for finer semantics. Just \"u.id\" tells us what the thing is, but not its role in the schema. I don't think it's very unusual to do this. The most obvious…",{"value":108,"source":66,"evidence":109},"Offset pagination check dismisses a real use case.",[110,114],{"id":111,"by":112,"text":113},"15024997","yellowapple","I feel like the author unjustly brushes aside the main benefit of using offsets for pagination (that is: the ability to query a specific page of results). Yeah, most page-based…",{"id":115,"by":116,"text":117},"15024717","combatentropy","A complicated solution to something that is not a problem, at least for my lowly business CRUD apps.",[119,123,129],{"value":120,"source":66,"evidence":121},"Provide evidence that each flagged pattern is actually bad.",[122],{"id":80,"by":81,"text":82},{"value":124,"source":46,"evidence":125},"Add a check requiring column names to be table-prefixed.",[126],{"id":127,"by":11,"text":128},"15020140","Thanks for sharing your perspective. I will add a new check to ensure that table columns are always be prefixed with table name. However, I still think that it is worthwhile to…",{"value":130,"source":66,"evidence":131},"Improve documentation for the join check.",[132,136],{"id":133,"by":134,"text":135},"15019240","snake_plissken","Interesting. Some bones to pick: https:\u002F\u002Fgithub.com\u002Fjarulraj\u002Fsqlcheck\u002Fblob\u002Fmaster\u002Fdocs\u002Fquery\u002F3013.md First, dat implicit, inner join. Second, it could be written more clearly…",{"id":137,"by":11,"text":138},"15020169","Can you please open an issue or send a PR to update the documentation? Thanks!",[140],{"value":141,"source":66,"evidence":142},"Does it work with SQL dialects like T-SQL?",[143],{"id":144,"by":145,"text":146},"15018965","sebazzz","Sounds good in theory. but I wonder how well it works for any SQL dialects. I write SQL in a dialect like T-SQL usually. The tool would probably not recognize the brackets or…",[],{"comments":33,"answered":37,"key":149},[150,151,152],{"id":84,"text":85},{"id":49,"text":50},{"id":127,"text":128},{"commenters":154,"max_depth":37,"maker_replies":33,"first_comment_mins":155,"lifespan_hours":156},17,280,18,[158,160,162,166,168,170,171,172,176,179,183,185,186,190,192,196,198,199,200,201,204,206,209,212,215,218],[69,30,32,159,70,30],"project\u002Fcritical\u002Fdocs",[80,30,37,161,81,30],"project\u002Fmixed\u002Fidea",[163,30,37,164,165,30],"15019527","project\u002Fneutral\u002Fidea","Twirrim",[84,30,30,167,11,32],"commenter\u002Fpositive\u002Fnone",[93,30,32,169,94,30],"project\u002Fcritical\u002Fidea",[49,30,30,164,11,32],[100,32,32,159,101,30],[173,32,37,174,175,30],"15019538","project\u002Fneutral\u002Fnone","itsdrewmiller",[177,32,30,178,116,30],"15024705","commenter\u002Fneutral\u002Fnone",[180,32,37,181,182,30],"15020037","project\u002Fneutral\u002Fdocs","mulmen",[127,32,30,184,11,32],"maker\u002Fpositive\u002Fdocs",[104,32,37,181,105,30],[187,32,30,188,189,30],"15022989","other\u002Fneutral\u002Fnone","nodesocket",[191,32,30,188,116,30],"15024689",[193,194,32,169,195,30],"15020567",2,"MarkusWinand",[52,194,30,197,11,32],"maker\u002Fpositive\u002Fnone",[115,194,32,169,116,30],[111,194,32,169,112,30],[133,37,32,159,134,30],[202,37,37,174,203,30],"15019381","temuze",[137,37,30,205,11,32],"maker\u002Fneutral\u002Fdocs",[207,37,30,208,134,30],"15020359","commenter\u002Fneutral\u002Fdocs",[210,39,30,188,211,30],"15019215","m-j-fox",[213,39,30,214,11,32],"15020785","maker\u002Fneutral\u002Fnone",[144,216,37,217,145,30],5,"project\u002Fneutral\u002Fexecution",[219,216,30,220,11,32],"15020239","maker\u002Fneutral\u002Fdesign",[],[223,228,233,237,242,247],{"id":224,"name":225,"points":226,"category":227},"15017126","howacarworks.com",845,"creative",{"id":229,"name":230,"points":231,"category":232},"14997799","BarbBlock",614,"security_privacy",{"id":234,"name":235,"points":236,"category":20},"15000947","Mathcha",358,{"id":238,"name":239,"points":240,"category":241},"14980075","Kozmos",197,"productivity",{"id":243,"name":244,"points":245,"category":246},"14982359","tenso.rs",196,"ai",{"id":248,"name":249,"points":250,"category":20},"14984167","Crackle",114,false,"v2",{"id":254,"name":5,"line":6,"ai":251,"cat":20,"year":13,"points":14,"comments":15,"rec":27,"s":28,"top":18,"kw":255,"maker":11,"domain":10,"tier":19,"attempts":30,"strip":256,"url":9,"mix":257,"praise":77,"objection":88,"sub":21},15016949,[24,21,25,26],"13301013030300101113000030",[30,31,32,33],1793990962829]