The tag has no usage guidance.

learn more… | top users | synonyms

12
votes
1answer
349 views

SQL Deadlock on the same exclusively locked clustered Key (with NHibernate) on delete / insert

I have been working on this deadlock issue for quite a few days now and no matter what I do, it persists in one way or another. First, the general premise: We have Visits with VisitItems in a one to ...
4
votes
1answer
163 views

Performance problems with TOP and user defined functions in views

I have problem with performance of queries on simple query on view. To keep things simple, assume my view is defined as follows: CREATE VIEW [mon].[ViewDevicesWithGroups] AS SELECT Id, Name, ...
2
votes
1answer
626 views

Paging in SQL Server: Is an order by clause required? (currently, rows are being missed)

We have some code that pages through a SQL result. (Currently running on SQL Server 2008) We notice that when paging is done, some rows are not returned. Let me clarify this a bit: nHibernate ...
5
votes
1answer
371 views

Which parameters was a stored procedure or command executed with?

We are using nHibernate which generates queries from .NET code. Occasionally, some queries get stuck in the sp_whoisactive list and we cannot find out why. I have a feeling that it has to do with a ...
0
votes
2answers
2k views

Join two subquery in hql

How can I write this sql query in as hql: select count(distinct s.id) as prepaid, count(distinct ss.id) as postpaid from (select * from subscriber where subscriber.ispostpaid=0) s join (select * ...
2
votes
0answers
241 views

Does Oracle ADO.NET varchar parameter size influence query plan reuse?

I am considering to apply a fix which will generate constant parameter sizes for (n)varchar parameters. The application is based on NHibernate with the old OracleClientDriver (using Microsoft Oracle ...
4
votes
2answers
226 views

removal of GUIDS used for all PK's, FKs & Clustered indexes

Inherited control over a database that has this nasty config. It also has large sections of code generated by NHibernate, including the gneeration of GUIDs before they get to the db so no chance of ...
3
votes
1answer
138 views

How can I monitor a production database to see if there are table scans happening?

How can I monitor a production database to see if there are table scans happening? And what indexes might fix them... I'm told that we have adequate indexes but I can't see every code path, and we ...