Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6363945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:06:06+00:00 2026-05-25T00:06:06+00:00

I am developing an application with NH and Sql Server. I have decided to

  • 0

I am developing an application with NH and Sql Server. I have decided
to go with the method of creating the database structure myself then
map with NH afterwards.

When creating a database structure I like to use foreign keys to
maintain referential integrity. In the cases where there is a one to
one table mapping which is nullable, I have in the past created a
dummy zero ID row on the lookup table. The reason that I have done
this is because I have seen that left join queries were not as
performant as full joins.

i am keen to improve and interested to get some advice for whether i
should pursue this again with my new database structure which would
mean getting NH to ignore zero ID’s globally upon selects somehow. i
suspect this could be fraught with danger when using NH and perhaps i
am better taking an alternative route with the database. any advice
very appreciated thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:06:06+00:00Added an answer on May 25, 2026 at 12:06 am

    The reason that I have done this is because I have seen that left join
    queries were not as performant as full joins.

    I don’t know enough about your application, performance requirements and the measurements that you did. But it might be worth not creating artificial 0 value in FK column just for the simplicity sake. The measurement that you did might no longer be relative or maybe this was not a bottleneck in the first place. Maybe there is a way to improve left join performance by putting index on FK column.

    What you need to know when mapping one-to-one in NHibernate is that lazy loading for nullable associations is not supported. Look at this answer for options.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an application that reads data from a SQL server database (migrated from
I'm developing a local application with a DataBase in SQL Server 2008 and Visual
I am developing an application which communicates with an SQL Server 2005 database to
I am developing a contact manager application using SQL Server 2008 (service-based database) .
I'm currently developing a web application in ASP.Net with SQL Server and I would
I am developing large data collecting ASP.Net/Windows service application-pair that uses Microsoft SQL Server
I've recently started developing my first serious application which uses a SQL database, and
I am developing a winforms application using .NET 2.0 and Sql Server 2005. I
We are developing a web application using asp.net and sql server. We are required
I am developing some reports in SSRS (SQL Server 2008 R2). I have given

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.