- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- index with null value field
Operating System - HP-UX
1753731
Members
4702
Online
108799
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2002 02:38 AM
07-05-2002 02:38 AM
index with null value field
Hello folks,
a simple question: I have a 'select' statement with such a 'where' condition
select from ... where X is null
I know that it is useless to put an index on 'X' column because every NULL is different from another NULL for Oracle.
Is it true? There is no way to increase the performance of such a query?
(I hope I'm wrong....)
Thanks
a simple question: I have a 'select' statement with such a 'where' condition
select from ... where X is null
I know that it is useless to put an index on 'X' column because every NULL is different from another NULL for Oracle.
Is it true? There is no way to increase the performance of such a query?
(I hope I'm wrong....)
Thanks
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2002 04:16 AM
07-05-2002 04:16 AM
Re: index with null value field
Just because NULL means 'undefined value' or 'unknown' does not mean that NULL values are not placed in indexes. When you query by a known value it returns just the rows with that value.
I just did a test on a big table where an indexed column had 369000 NULLs and 4 rows where the column = "000000". Querying the count of "000000"s returned 4 (it ignored the NULLS) and counting the NULLS returned 369000 straight away.
Before judging whether to add an index to a column you need to judge the following:
Is the table write-bound? Ratio of writes/reads?
How many rows in the table? These days with expensive optimisers the cutover point can get up to 1000 rows before its worth adding an index. This depends on the record length and number of records to a page.
How many updates to this column generally?
What is the cardinality of the column i.e. the number of unique values? The more the better. If its a flag then generally don't bother with the index, consider partitioning instead.
How many applications/queries access this column? It may be better to leave it un-indexed if it is hardly ever queried-by. Are you just looking into this for data-checking or everyday use?
I just did a test on a big table where an indexed column had 369000 NULLs and 4 rows where the column = "000000". Querying the count of "000000"s returned 4 (it ignored the NULLS) and counting the NULLS returned 369000 straight away.
Before judging whether to add an index to a column you need to judge the following:
Is the table write-bound? Ratio of writes/reads?
How many rows in the table? These days with expensive optimisers the cutover point can get up to 1000 rows before its worth adding an index. This depends on the record length and number of records to a page.
How many updates to this column generally?
What is the cardinality of the column i.e. the number of unique values? The more the better. If its a flag then generally don't bother with the index, consider partitioning instead.
How many applications/queries access this column? It may be better to leave it un-indexed if it is hardly ever queried-by. Are you just looking into this for data-checking or everyday use?
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP