Forum Replies Created

Viewing 15 posts - 91 through 105 (of 312 total)

  • RE: Need some help with this query

    J Livingston SQL (5/8/2015)


    New Born DBA (5/6/2015)


    I have this query which runs every night pulls 800,000+ records. I just wanted to know if there is a way to make it...

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • RE: Need some help with this query

    Long story short is that the clustered index on C1 column cannot be dropped. I was going to suggest maybe using C1 column in where clause, but I don't think...

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • RE: Need some help with this query

    Lynn Pettis (5/7/2015)


    New Born DBA (5/7/2015)


    Sorry, but I actually spit soda out my nose on this comment:

    Well I hope you are OK. 😀

    It isn't a system field, the column c1is...

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • RE: Need some help with this query

    Sorry, but I actually spit soda out my nose on this comment:

    Well I hope you are OK. 😀

    It isn't a system field, the column c1is a user defined column on...

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • RE: Need some help with this query

    New Born DBA (5/6/2015)


    My suggestion, if most of your SELECT queries read on column C6, is to change the primary key from a CLUSTERED index to a NONCLUSTERED index and...

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • RE: Need some help with this query

    My suggestion, if most of your SELECT queries read on column C6, is to change the primary key from a CLUSTERED index to a NONCLUSTERED index and then make the...

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • RE: Need some help with this query

    So COL_CORE_Audit_Data is a view? Need to see the DDL for the view and the underlying tables and the indexes on the tables.

    Index 1:CREATE NONCLUSTERED INDEX [I387_6_1] ON [dbo].[T387]

    (

    [C6]...

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • RE: Need some help with this query

    So COL_CORE_Audit_Data is a view? Need to see the DDL for the view and the underlying tables and the indexes on the tables.

    Table:

    CREATE TABLE [dbo].[T387](

    [C1] [nvarchar](15) NOT NULL,

    [C2] [nvarchar](254) NULL,

    [C3]...

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • RE: Need some help with this query

    Lynn Pettis (5/6/2015)


    New Born DBA (5/6/2015)


    See the issue is that I don't even know why SQL Server uses this Index? This Index is useless in this situation because column C1...

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • RE: Need some help with this query

    See the issue is that I don't even know why SQL Server uses this Index? This Index is useless in this situation because column C1 is ID column which is...

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • RE: Need some help with this query

    New Born DBA (5/6/2015)


    Query returns all data modified in the past 31 days.

    Without seeing the indexes defined on the table, not much more can be done.

    Index Info.

    /****** Object: Index...

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • RE: Need some help with this query

    Query returns all data modified in the past 31 days.

    Without seeing the indexes defined on the table, not much more can be done.

    Well the thing is this query uses this...

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • RE: Need some help with this query

    J Livingston SQL (5/6/2015)the last 31 days...?????

    Yes

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • RE: Need some help with this query

    New Born DBA (5/6/2015)


    Lynn Pettis (5/6/2015)

    Looks like you are storing date information as seconds since midnight 1970-01-01, correct?

    Yes, that is correct.

    So, what is the where clause attempting to filter?

    Sorry, but...

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • RE: Need some help with this query

    Lynn Pettis (5/6/2015)

    Looks like you are storing date information as seconds since midnight 1970-01-01, correct?

    Yes, that is correct.

    So, what is the where clause attempting to filter?

    Sorry, but I don't know.

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

Viewing 15 posts - 91 through 105 (of 312 total)