Re: [nhusers] Re: nhiberanate count(*) change to count(1)

2018-08-30 Thread Danny Van den Wouwer
Hi, Can you: 1. show me your query (hql, icriteria, queryover or Linq) and the generated query by nhibernate 2. show me the sql that you actually want Met vriendelijke groeten, Danny Van den Wouwer *Software Engineer* *PEOPLEWARE* Duwijckstraat 17 2500 Lier - Belgium +32 3

Re: [nhusers] Re: nhiberanate count(*) change to count(1)

2018-08-30 Thread 郭骞
Hi Danny, I use sql server 2012,for count(1) query will improve a lot because it just return row_number 在 2018年8月28日星期二 UTC+8下午5:04:09,Danny Van den Wouwer写道: > > Good database software knows that if you use the aggregate function > count(*) you don't want to retrieve internally all

Re: [nhusers] Re: nhiberanate count(*) change to count(1)

2018-08-30 Thread 郭骞
Acturely It's not same, 在 2018年8月28日星期二 UTC+8下午4:42:40,Ricardo Peres写道: > > Yes, COUNT(1) and COUNT(*) are exactly the same. > > RP > > On Monday, August 27, 2018 at 10:08:02 PM UTC+1, Gunnar Liljas wrote: >> >> It's certainly possible, but I don't understand why it would be an >> advantage.

Re: [nhusers] Re: nhiberanate count(*) change to count(1)

2018-08-28 Thread Danny Van den Wouwer
Good database software knows that if you use the aggregate function count(*) you don't want to retrieve internally all fields of all the involved tables. So count(*) might even be slightly faster then count(1) in those cases. It is not a good idea to change this behaviour to count(1). Can you

Re: [nhusers] Re: nhiberanate count(*) change to count(1)

2018-08-28 Thread Ricardo Peres
Yes, COUNT(1) and COUNT(*) are exactly the same. RP On Monday, August 27, 2018 at 10:08:02 PM UTC+1, Gunnar Liljas wrote: > > It's certainly possible, but I don't understand why it would be an > advantage. > > /G > > Den mån 27 aug. 2018 kl 22:55 skrev Ricardo Peres >: > >> I agree. Why don't

Re: [nhusers] Re: nhiberanate count(*) change to count(1)

2018-08-27 Thread Gunnar Liljas
It's certainly possible, but I don't understand why it would be an advantage. /G Den mån 27 aug. 2018 kl 22:55 skrev Ricardo Peres : > I agree. Why don't you create an issue on > https://github.com/nhibernate/nhibernate-core? Maybe someone can pick it > up. > > RP > > On Monday, August 27, 2018