Query Best Practices

Within PaymentNet, there are many opportunities to search for data by running reports, mappers, and queries.

In some situations, you will want to conduct a broad search. For example, a broad search can be useful if you want to find transaction records associated with a particular merchant but you can only remember the first two letters of the merchant name. Or perhaps you want to look at all transactions processed within a specific time period with the intention of culling the list further afterward.

At other times, you will want your search to be more focused and narrow. For example, a narrow search can be useful if you want to view all the transactions a particular cardholder made on a particular day. Or perhaps you want to total all spend incurred in a specific city.

The information in the following table will help you decide how to structure your search based on what you are trying to achieve. This table also explains how searches are processed and provides tips on how to run them most successfully.

Query Usage Best Practices

Search Type

Pros

Cons

Typical Search Criteria

Wide, Broad Search

A broad search:

  • helps if you are not exactly sure what you are looking for.

  • helps if you are concerned that a narrow search might leave out data you want to be included.

  • lets you spot trends or patterns across a large body of data.

The more information pulled in a broad search, the longer it takes to run. Too much information may cause a search to fail.

You may need to run multiple searches to cull the results, or you may need to spend a lot of time manipulating the data to find what you are looking for.

Search criteria include:

  • Search terms like Contains, Begins with, Ends with, Is greater than, Is less than

  • Multiple OR statements

  • Broad date ranges

Targeted, Narrow Search

A narrow search:

  • returns only the specific information you need

  • results in better system performance and faster results

  • allows you to distinguish between similar data. For example, if you have 100 users named John Smith, a targeted search will help you find John G. Smith vs. John H. Smith.

You might miss the results you seek if the search isn’t constructed exactly right.

You may run into data quality issues (false negatives) if the data and the search criteria don’t match precisely.

You may need to run multiple versions of the same search to see how much impact the search criteria are having on the results.

Search criteria include:

  • Search terms like Is equal to, Is between

  • Order By or Sort criteria

  • Multiple AND statements

  • Specific dates