SyteLine Large Table Scan Cost Calculator: Scan vs Index Seek in SQL Server
This calculator compares the IO cost of a full scan with an index seek on large SyteLine tables such as matltran_mst, jobtran_mst and ledger_mst on SQL Server. It shows why one non-sargable filter in a report or IDO can turn milliseconds into tens of seconds as history grows.
Your numbers
Use sp_spaceused on the table, for example matltran_mst.
Data size from sp_spaceused divided by rows.
index_depth from sys.dm_db_index_physical_stats; 3 to 4 is typical for large tables.
Your results
A simplified IO model. Random reads for key lookups are slower per MB than sequential scans on spinning disk, and the optimizer may choose a scan on purpose when many rows match. Confirm with the actual execution plan and SET STATISTICS IO.
Scan vs seek time as the table grows
Sweeps Table rows from 1000000 to 100000000, holding your other inputs fixed.
Send us your slowest SyteLine query
Share the query text and its STATISTICS IO output and we will suggest a sargable rewrite or index change, checked against SyteLine posting load.
Optional. The tool and every export work without this. No spam.
The basis: pages, not rows
SQL Server stores data in 8 KB pages, and a row can hold up to 8,060 bytes of in-row data. The calculator uses 8,060 bytes as the usable space per page, which is close to the real figure (a page has a 96-byte header and a row offset array) and ignores fill factor, so it slightly underestimates page count. A scan reads every page of the table: pages = rows x row bytes / 8,060. A seek walks the B-tree from root to leaf (index depth pages) and then reads only the matching rows. If the index does not include every column the query needs, each row costs a key lookup into the clustered index; worst case that is one page per row. Time is MB read divided by read speed, split between cached and uncached pages.
What makes SyteLine queries scan
The common culprits in SyteLine reports, IDO filters and custom procedures are predicates the optimizer cannot match to an index. Wrapping the column in a function, such as CONVERT(date, trans_date) = '2026-10-01' on matltran_mst, forces evaluation on every row; write a range on the raw column instead. A leading wildcard, item LIKE '%-100', cannot seek. Implicit conversions between varchar and nvarchar parameters do the same. Long OR chains across different columns often scan too, while IN on one indexed column usually seeks. Filters built in a form's filter-in-place with wildcards end up in the same IDO query, so users can trigger scans without any custom code.
- Use trans_date >= @from AND trans_date < @to, not functions on the column
- Avoid leading % in LIKE on large tables
- Match parameter data types to column types
- Prefer IN on one indexed column over OR across columns
Worked example
A 20 million row matltran_mst at 450 bytes per row is about 1.1 million pages, roughly 8.5 GB. With 30% of it cached, a full scan reads about 6 GB from storage at 300 MB/s plus 2.6 GB from memory, about 21 seconds, and it also pushes useful pages out of the buffer pool for everyone else. A seek returning 500 rows through a 4-level index with key lookups reads about 504 pages, under 4 MB, roughly 13 milliseconds even fully cold. The ratio is in the thousands. Grow the table to 60 million rows and the scan triples while the seek stays flat, which is why reports that were fine at go-live degrade every year.
Check the real cost in SQL Server
Run the query in SQL Server Management Studio with SET STATISTICS IO ON and SET STATISTICS TIME ON, then read logical reads per table in the Messages tab: compare that figure with the table pages output here. Include the actual execution plan and look for Clustered Index Scan or Table Scan on the large table, and for Key Lookup operators with high row counts. The estimated subtree cost in the plan is the optimizer's internal unit, not seconds, so use it only to compare plans. For problems happening right now, use the blocking and long-running query script tool to see which session is scanning.
Frequently Asked Questions
How do you calculate query cost in SQL Server?
SQL Server shows an estimated subtree cost in the execution plan, a unitless optimizer figure for comparing plans. For real cost, use SET STATISTICS IO ON to get logical and physical reads per table and SET STATISTICS TIME ON for CPU and elapsed time. Logical reads times 8 KB is the data volume touched.
Is IN faster than OR in SQL Server?
For several values on the same column, IN and OR usually produce the same plan, because the optimizer rewrites one into the other. The difference appears with OR across different columns, which often prevents a single index seek and leads to a scan. Check the plan rather than relying on the syntax.
Why is my query on matltran_mst slow?
matltran_mst holds every material transaction and grows for years. A filter that cannot use an index, such as a function on trans_date or a leading wildcard on item, scans the whole table. Rewrite the filter as a range on the raw column and check that an index supports the filter columns.
Does adding an index always help?
No. Each index adds write cost to every insert and update on the table, and SyteLine posts transactions constantly. Add an index only when the plan shows a scan or heavy key lookups for a frequent query, prefer adding included columns to an existing index, and test on a copy before production.
If you want people to ask SyteLine history questions in plain English without writing scans against production, we can run a private AI layer on your servers that uses indexed, reviewed queries on a reporting copy.
Related Tools
SyteLine SQL Blocking and Long Running Query Script Generator
Builds read-only SQL Server diagnostic scripts for blocking, head blockers, open transactions and slow requests on a SyteLine database.
Developer ToolsSQL Server Index Size Estimator Calculator
Estimate how many GB a new nonclustered index will add to your ERP database, and see how fill factor changes the size.
Developer ToolsSQL Server Wait Types Reference for ERP Databases
Searchable lookup of common SQL Server wait types with plain-language meaning, typical cause in an ERP workload and the first thing to check.
Infor SyteLineSyteLine TaskMan Background Queue Calculator
See whether TaskMan can keep up with the reports and utilities your users submit, how big the backlog gets after the peak and how long it takes to clear.
More Developer Tools tools
See all- SyteLine IDO REST Request Generator
- SyteLine SQL Query Generator for Item, Job and Order Tables
- SyteLine Custom Table CREATE Script Generator
- SyteLine Mongoose Framework Events Reference
- SyteLine Event Action Types Reference
- SyteLine Event Action Parameter Functions Reference
- SyteLine WinStudio Standard Form Events Reference
- SyteLine Mongoose API Options Reference
- SyteLine SQL User-Defined Data Types Reference
Keep exploring
Free tools
- SyteLine Item Master Fields ReferenceSearchable list of important item_mst fields with typical values and what each one drives in planning, costing and inventory.
- SyteLine Custom Table CREATE Script GeneratorCreates a SQL Server CREATE TABLE script for a custom SyteLine table that follows the standard column and key conventions.
- SyteLine IDO REST Paging Throughput CalculatorEstimate how many REST calls, how much payload and how long a bulk IDO read takes for a given recordcap, and find a page size that avoids timeouts.
ERP fixes and how-tos
- SyteLine Inventory Adjustment: Insufficient Quantity on HandSyteLine rejects a miscellaneous issue or adjustment as insufficient quantity. Learn why location, lot and warehouse totals disagree and how to reconcile safely.
- SyteLine item usage report: get item consumption historyHow to get item usage history in SyteLine for reorder points and MRP tuning: standard transaction reports, a SQL pull from matltran and an Excel pivot.
- Work order (job) item, status and routing tables in SyteLineWhere SyteLine stores work orders (jobs), routings, operations and materials: job, jobroute, jobmatl, jobtran tables, status values and sample SQL queries.
Guides
- A Practical Guide to SyteLine's Core SQL TablesA practical guide to the core SyteLine SQL tables, customer orders, lines, items, purchasing, jobs, their join paths, _mst conventions, and site_ref scoping for correct queries.
- Implementing QR Code Tracking in SyteLine OperationsImplement QR code tracking in Infor SyteLine for items, assets, and documents. Configure QR generation, encoding schemes, and scan workflows for CloudSuite Industrial.
- How to Fix Slow MRP Performance in SyteLineSpeed up SyteLine MRP runs that take hours instead of minutes. Covers SQL optimization, MRP parameters, data cleanup, and parallel processing configuration.