Skip to content

Conversation

@Daniel-KM
Copy link

Hi,

An improvement of the routing system for simple pages, that was too slow when they are too many.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

@zerocrates
Copy link
Member

I think it would be better to use a purpose-built select rather than adapting findPairsForSelectForm for this usage. Something like

// ...
$select = $db->getTable('SimplePagesPage')->getSelect();
$select->reset(Zend_Db_Select::COLUMNS);
$select->from(array(), array("$alias.slug"));
$slugs = $db->fetchCol($select);

Then you wouldn't need the changes you've done in the SimplePagesPage Table class. That snippet could go directly in the define_routes, or be a findSlugs method on the Table with only minor changes.

Generally, this change looks like makes sense, because the current system would add a large number of routes for a large number of pages, and you'd take the hit from all those extra routes on every page load, even those not actually showing a simple page. Out of curiosity, how many pages did you get up to when you started seeing performance issues?

@Daniel-KM
Copy link
Author

Hi,

I replaced the findPairsForSelectForm() by the findSlugs().

I have a problem on a site with 70 pages and 200 items, but this is on a shared host I don't manage. I can't determine if the issue is linked to the server, mysql or php.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants