nerdexam
LPI

117-301 · Question #115

An administrator notices that searches are being processed sequentially and taking a long time to complete. What should be done to speed up the searches?

The correct answer is A. Add the correct indexes in slapd.conf, stop the server and run slapindex. See the full explanation below for the reasoning.

Question

An administrator notices that searches are being processed sequentially and taking a long time to complete. What should be done to speed up the searches?

Options

  • AAdd the correct indexes in slapd.conf, stop the server and run slapindex.
  • BRefine the search filter.
  • CUse the -binarytreesearch option with ldapsearch.
  • DUse the -fuzzy option with ldapsearch.

How the community answered

(38 responses)
  • A
    71% (27)
  • B
    16% (6)
  • C
    5% (2)
  • D
    8% (3)

Community Discussion

4
Lena V.Lena V.Jun 26, 2026

Answer is A, and this is one of those questions where knowing the why saves you on the harder variants they throw at you. OpenLDAP without proper indexes does a full linear scan of every entry for each search, which is exactly why you see that sequential processing slowdown. You define the indexes in slapd.conf using the index directive for the attributes you actually query on, then you stop the server and run slapindex to build the index files from your existing data. The server has to be down during slapindex because it writes directly to the database and a live server would corrupt things. B is a distractor about client-side query hygiene, not server performance, and C and D describe options that simply do not exist in ldapsearch, so those are easy eliminations once you know the tool.

10
Yusuf A.Yusuf A.Jun 28, 2026

One thing my senior drilled into me is that after you edit slapd.conf to add the index directives, you also need to run slapindex as the same user that owns the database files, otherwise you end up with permission errors that look confusing at first.

0
Yusuf A.Yusuf A.Jun 26, 2026

Answer is A, though I almost went with B because my senior keeps telling me to write better filters anyway, so that felt right. But he also showed me that without proper indexes in slapd.conf, even a perfect filter still forces a full sequential scan, and you have to stop the service and run slapindex after adding them or the database never actually gets rebuilt.

5
Anjali D.Anjali D.Jun 26, 2026

Our group landed on A pretty quickly since indexing is the classic fix for sequential LDAP scans, but I want to make sure everyone understands why you also have to stop the server and run slapindex after editing slapd.conf rather than just restarting it. Does anyone know what actually happens to existing entries in the database if you add a new index but skip the slapindex step?

0
Full 117-301 Practice