<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Question2Answer Q&amp;A - Recent questions tagged replace</title>
<link>https://www.question2answer.org/qa/tag/replace</link>
<description>Powered by Question2Answer</description>
<item>
<title>REPLACE query is sometimes very slow</title>
<link>https://www.question2answer.org/qa/45016/replace-query-is-sometimes-very-slow</link>
<description>

&lt;p&gt;&lt;span style=&quot;font-size:20px&quot;&gt;Issue summary&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;On my site,&amp;nbsp;REPLACE query for qa_options table is very slow. Performance of&amp;nbsp;INSERT and&amp;nbsp;UPDATE&amp;nbsp;are standard. But, only REPLACE is sometimes very slow. In some cases there is a performance difference of 100 times.&amp;nbsp;&lt;strong&gt;It is not always occur.&lt;/strong&gt;&amp;nbsp;For example (worst case) ...&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;REPLACE :&amp;nbsp;&lt;span style=&quot;color:rgb(255, 0, 0)&quot;&gt;&lt;strong&gt;300ms - 500ms&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;&lt;span style=&quot;font-size:20px&quot;&gt;My experiment&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;I was remodeled qa_db_set_option() of&amp;nbsp;qa-include/db/options.php.&lt;/p&gt;

&lt;ol&gt;

&lt;li&gt;Case1 (DELETE + INSERT) &amp;gt;&amp;gt;&amp;gt; &lt;span style=&quot;color:#FF8C00&quot;&gt;&lt;strong&gt;7ms - 10ms&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;

&lt;li&gt;Case2 (SELECT + INSERT / UPDATE) &amp;gt;&amp;gt;&amp;gt; &lt;span style=&quot;color:#008080&quot;&gt;&lt;strong&gt;0.5ms - 1ms (Best performance!)&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt;If you have&amp;nbsp;information about this issue, please tell me.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://bugs.mysql.com/bug.php?id=71507&quot; rel=&quot;nofollow&quot;&gt;http://bugs.mysql.com/bug.php?id=71507&lt;/a&gt; ???&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-size:20px&quot;&gt;Server spec&lt;/span&gt;&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;Dedicated server (Web server and database server&amp;nbsp;exist on same hardware)&lt;/li&gt;

&lt;li&gt;MySQL version: 5.0&lt;/li&gt;&lt;/ul&gt;</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/45016/replace-query-is-sometimes-very-slow</guid>
<pubDate>Tue, 28 Apr 2015 05:57:30 +0000</pubDate>
</item>
<item>
<title>Update Plugin: Lang Filter (V1.0.1)</title>
<link>https://www.question2answer.org/qa/23318/update-plugin-lang-filter-v1-0-1</link>
<description>

&lt;p&gt;
	This plugin replace specific word of lang system of Q2A at once.
&lt;br&gt;
	Refer to readme in download-file for description.&lt;/p&gt;


&lt;p&gt;
	&lt;img alt=&quot;&quot; src=&quot;www.question2answer.org/qa/?qa=blob&amp;amp;qa_blobid=8377689810483781862&quot; style=&quot;width: 480px; height: 339px;&quot;&gt;&lt;/p&gt;


&lt;p&gt;
	The phrase of Q2A are taken out from lang file in following order.&lt;/p&gt;


&lt;ol&gt;
	

&lt;li&gt;
		qa-lang/custom/qa-lang-*.php&lt;/li&gt;
	

&lt;li&gt;
		qa-lang/(language code)/qa-lang-*.php&lt;/li&gt;
	

&lt;li&gt;
		qa-include/qa-lang-*.php&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;
	When changing expression, it is best to correct lang souce file.&amp;nbsp;But this plugin may be useful when changing words and phrases at once easily.&amp;nbsp;In addition, this version changes word simply by str_replace of PHP.&amp;nbsp;if this plugin is helpful also to heavy users of Q2A, It may be better to also&amp;nbsp;add replace function by regular expression(preg_replace),&amp;nbsp;And,&amp;nbsp;Since the dictionary used&amp;nbsp;for conversion is cached on memory,&amp;nbsp;risk of performance worsening is minimum.&amp;nbsp;&lt;/p&gt;


&lt;ol&gt;
	

&lt;li&gt;
		&lt;a href=&quot;http://www.question2answer.org/qa/?qa=blob&amp;amp;qa_blobid=18040836481879133620&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Screen shot 1&lt;/a&gt;: admin -&amp;gt; plugins&lt;/li&gt;
	

&lt;li&gt;
		&lt;a href=&quot;http://www.question2answer.org/qa/?qa=blob&amp;amp;qa_blobid=10204427705510339163&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Screen shot 2&lt;/a&gt;: admin -&amp;gt; plugins -&amp;gt; options (default)&lt;/li&gt;
	

&lt;li&gt;
		&lt;a href=&quot;http://www.question2answer.org/qa/?qa=blob&amp;amp;qa_blobid=8377689810483781862&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Screen shot 3&lt;/a&gt;: admin -&amp;gt; plugins -&amp;gt; options (after setting)&lt;/li&gt;
	

&lt;li&gt;
		&lt;a href=&quot;http://www.question2answer.org/qa/?qa=blob&amp;amp;qa_blobid=13852420547596425004&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Screen shot 4&lt;/a&gt;: page view&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;
	&lt;span style=&quot;font-size:16px;&quot;&gt;Compatibility&lt;/span&gt;&lt;/p&gt;


&lt;p&gt;
	1.5.x, 1.6.x, &lt;span style=&quot;color:#ff0000;&quot;&gt;&lt;strong&gt;1.7 (2014/12/19 Updated)&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;span style=&quot;font-size:16px;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color:#006400;&quot;&gt;&lt;a href=&quot;http://cmsbox.jp/archive/download.php?t=d&amp;amp;i=42&quot; rel=&quot;nofollow&quot;&gt;Download&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;


&lt;p&gt;
	Best regards.&lt;/p&gt;


&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;</description>
<category>Plugins</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/23318/update-plugin-lang-filter-v1-0-1</guid>
<pubDate>Sat, 20 Apr 2013 20:00:08 +0000</pubDate>
</item>
<item>
<title>Shortcode replacement plugin?</title>
<link>https://www.question2answer.org/qa/13083/shortcode-replacement-plugin</link>
<description>

&lt;p&gt;
	Here's a simple plugin, it replaces certain text with other text in questions, answers, and comments.&lt;/p&gt;


&lt;p&gt;
	EDIT: now supports regex and html tag substitution&lt;/p&gt;


&lt;p&gt;
	Mostly for simple shortcode replacing, e.g.:&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;[my-shortcode]&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	with:&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;&amp;lt;a href=&quot;&lt;a href=&quot;http://mysite.com/&quot;&amp;gt;My&quot; rel=&quot;nofollow&quot;&gt;http://mysite.com/&quot;&amp;gt;My&lt;/a&gt; Site!&amp;lt;/a&amp;gt;&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	Feedback welcome, the code is here:&lt;/p&gt;


&lt;p&gt;
	&lt;a href=&quot;https://github.com/NoahY/q2a-shortcode&quot; rel=&quot;nofollow&quot;&gt;https://github.com/NoahY/q2a-shortcode&lt;/a&gt;&lt;/p&gt;</description>
<category>Plugins</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/13083/shortcode-replacement-plugin</guid>
<pubDate>Tue, 28 Feb 2012 08:07:50 +0000</pubDate>
</item>
</channel>
</rss>