0

I am working with a 300K records dataset and I am having some performance issues. I try creating a node for each of the records on the dataset, but even the simple path translation query is taking forever (over 50ms to execute) to get the node ID from the page and the rest of the queries on the page make it insanely slow to load a single page. The server has all the capacity it might need and it even has memcached working, PHP-FPM, NGINX, etc.

I decided to have each page coming from that dataset as simple as possible to avoid having to load all those objects and so on. The question comes when I want to use the url:

http://www.example.com/item-ABBC

ABBC is the argument that will hit the database to perform a search, but I can figure out how to accomplish this with the hook_menu:

function mymodule_menu() {
    $items['item-%'] = array(
      'page callback' => 'mymodule_abbc_view',
      'type' => MENU_CALLBACK,
    );
    return $items;
}

I am trying to avoid hitting the path table as much as possible that is why I wanted to use the MENU_CALLBACK instead of a regular menu item.

Is this possible at all?

1 Answer 1

2

The way Drupal works out of the box, you need to separate your arguments with /. So your URL should be 'item/%'.

2
  • So I will have to use a path to go from item/% to item-%
    – Emil Orol
    Commented Jan 28, 2015 at 13:14
  • That's an option, but what will you do if user go directly to item-%? Commented Jan 28, 2015 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.