Monday, 28 November 2016

Re: [firebird-support] Speed of comparing one field to another

 

Yes, you can, using an expression index

CREATE INDEX IDX_MYINDEX ON MY_TABLE COMPUTED BY (INVOICED - RECEIVED);

and your SELECT would be:

SELECT
   *
FROM
   MY_TABLE
WHERE
   INVOICED - RECEIVED < 0

That way you will not need to create an additional column neither to do an UPDATE neither to create a trigger.

Greetings.

Walter.


On Tue, Sep 13, 2016 at 9:26 AM, Maya Opperman maya@omniaccounts.co.za [firebird-support] <firebird-support@yahoogroups.com> wrote:
 

Hi,

 

I have a large table, and I'm only extracting a few records using:

 

Select t.ID

From my_table t

Where t.Invoiced < t.Received

 

Invoice and received are of type decimal(18,5)

 

IBExpert is reporting these as unindexed reads.

 

Is there an index I could create to speed up the loading?

 

Thanks in advance

Maya

 

 


__._,_.___

Posted by: "Walter R. Ojeda Valiente" <sistemas2000profesional@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (5)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.

__,_._,___

No comments:

Post a Comment