DapperLib / Dapper

Dapper - a simple object mapper for .Net
https://www.learndapper.com/
Other
17.56k stars 3.67k forks source link

help! dapper excute sql with group by is very slow #1302

Closed nocomplain closed 5 years ago

nocomplain commented 5 years ago

sql: SELECT lz.LabelDetailId FROM zydescription_view as zd INNER JOIN ZyExtend ze ON zd.Id = ze.Id INNER JOIN labelzy as lz on lz.ZyId = zd.Id and lz.SysStatus = 0 WHERE zd.SysStatus = 0 AND (zd.ReviewStatus = 1 OR zd.UpdateStatus = 1) and zd.Catalog like '%5326f1d4-819f-431f-9fa4-ba9043792c91%' group by lz.LabelDetailId

c# code: var result = connection.Query(sql);

when remove group by, it takes 200ms and result with 9000+ rows but with group by,it taks 4500ms and result with 33 rows only can any one help me, how to resove this. thanks very much. it really confused me! i have been googled a long time. the group by column type int excute group by sql in mysql managment cost 300ms

mgravell commented 5 years ago

Looks like you figured out what was happening here. Any chance of a two line summary? Like "it was a bad index" or something?

TenniswoodConnie commented 1 month ago

Last year, I decided to invest $30,000 in cryptocurrency, enticed by promises of substantial weekly profits. Initially, everything seemed fine. I was hopeful and excited, convinced that this investment would not only safeguard my savings but also enhance my financial status. I was living comfortably, enjoying the benefits of my spending, and felt secure in my investment strategy. However, my optimism quickly turned into dismay. After a few days of monitoring my investment, I noticed that the website associated with my investment had gone offline. I tried to access my account, only to find that it had disappeared entirely. It was then that I realized I had been scammed. My investment, which I had carefully saved and trusted, was gone. The frustration and helplessness I felt were overwhelming. .I tried everything I could think of to recover my Bitcoin. I reached out to my wallet provider, contacted my bank, and even reported the incident to law enforcement. Despite my best efforts, none of these avenues yielded any results. It seemed like my money was lost for good, and I was left feeling defeated and hopeless. As time went on, I continued to search for solutions, but nothing seemed to work. That was until a few weeks ago when I was introduced to Trust Geeks Hack Expert. Initially, I was skeptical, having been let down by so many other attempts to recover my funds. But I decided to give Trust Geeks Hack Expert a try, hoping they might be able to offer a solution where others had failed. From. From the moment I reached out to them, I was met with a level of professionalism and dedication that I had not encountered before. They took the time to understand the details of my case and formulated a comprehensive plan to recover my lost funds. Their approach was thorough, and they maintained open communication throughout the entire process, keeping me updated on every development. To my immense relief and joy, Trust Geeks Hack Expert succeeded where all my previous efforts had fallen short. They were able to recover the full amount of my stolen investment. The experience was transformative, I got back my money and regained a sense of hope and confidence that I had lost along the way. If you find yourself in a situation similar to mine—having lost cryptocurrency to a scam—I strongly recommend reaching out Website.. https://trustgeekshackexpert.com/. Their expertise and commitment to their clients are truly commendable. They offer a glimmer of hope and a real chance to recover what was taken from you. You can contact Trust Geeks Hack Expert directly by Email <> trustgeekshackexpert[At]fastservice[Dot]com for their services. They specialize in handling such cases and have a proven track record of helping people like me reclaim their lost assets. Their support was invaluable, and I am incredibly grateful for their assistance. In sharing my story, I hope to provide some guidance and reassurance to others who might be struggling with similar issues. Investing in cryptocurrency comes with risks, and it’s crucial to be aware of where you place your trust. But remember, with the right help and persistence, there is still hope for recovery. Stay vigilant, protect your investments, and if you need assistance, don’t hesitate to reach out to professionals like Trust Geeks Hack Expert